【发布时间】:2020-12-31 05:03:34
【问题描述】:
我有弹性搜索索引,我需要其中一个字段(“actual_start”)不为空的记录总数,我该怎么做?
我已经编写了这个查询,我想将非空实际起始值的计数附加到我的查询结果中:
$params = [
'index' => "appointment_request",
'body' => [
'from' => $request['from'],
'size' => $request['size'],
"query" => [
"bool"=>[
"must" => [
[
"term" => [
"doctor_id" => [
"value" => $request['doctor_id']
]
]
],
[
"match" => [
"book_date" => $request['book_date']
]
],
]
],
]
]
];
【问题讨论】:
标签: elasticsearch elasticsearch-aggregation