【发布时间】:2018-04-15 22:55:35
【问题描述】:
我正在使用http://elasticsearch-dsl.readthedocs.io在python中编写查询dsl
我有以下代码
search.aggs.bucket('per_ts', 'terms', field='ts')\
.bucket('load_time', 'percentiles', field='total_req', percents=[99])
response = search.execute()
这工作正常,但它也返回hits。但我不想要hits
在 curl 查询模式下,我可以通过 size:0 in 得到我想要的
GET /twitter/tweet/_search
{
"size": 0,
"aggregations": {
"my_agg": {
"terms": {
"field": "text"
}
}
}
}
我找不到可以在查询 dsl 中使用 size = 0 的方法。
【问题讨论】:
标签: python elasticsearch elasticsearch-5