有没有办法限制用于构面聚合的行数?例如:如果我的查询按日期过滤记录并且大小也为 300,则分面会忽略大小并仅返回该日期范围的分面。有没有办法只为这 300 条记录返回构面?
curl -X GET 'localhost:9200/some_index/some_type/_search?routing=1&search_type=count&size=300&pretty' -d '{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "account:1"
}
},
{
"query_string": {
"query": "\"postedTime:[2013-06-12T01:00 TO 2013-06-19T01:00]\""
}
}
]
}
},
"sort": [
{
"postedTime": "asc"
}
],
"facets": {
"products": {
"terms": {
"field": "product",
"size": 10,
"all_terms": false
}
},
"types": {
"terms": {
"field": "type",
"size": 10,
"all_terms": false
}
}
},
"size": 300,
"version": true
}'