Ответ 1
Вы можете использовать count search_type:
curl -XGET 'http://localhost:9200/main/events/_search?search_type=count&pretty=true' -d '
{
"facets" : {
"histo1" : {
"query" : {
"query_string" : {"query":"*:*"}
},
"date_histogram" : {
"field" : "time",
"interval" : "minute"
}
}
}
}
'
В качестве альтернативы вы можете установить "size":0
в свой запрос, но он будет менее эффективным:
curl -XGET 'http://localhost:9200/main/events/_search?pretty=true' -d '
{
"facets" : {
"histo1" : {
"query" : {
"query_string" : {"query":"*:*"}
},
"date_histogram" : {
"field" : "time",
"interval" : "minute"
}
}
},
"size":0
}
'