tinaElasticsearch 的 Python 客户端

联合创作 · 2023-09-29

tina 是 Elasticsearch 的 Python client,提供较为方便的查询语法。

# SQL
select * from "ExampleModel" where "name" = "tina"
# tina
models, total = ExampleModel.where('name', equal='tina').fetch()
# SQL select * from "ExampleModel" where "category" = 1 or "category" = 3        order by "created_at" limit 20 offset 20
# Python
models, total = ExampleModel.where('category', contains=[1, 3])\        .order_by('created_at').fetch(20, 20)
浏览 2
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报