I found that the terms aggregations always inspect the entire collection, for example I use
{
"query": {
"match": {
"text field": "some text"
}
},
"aggs": {
"agg-terms": {
"terms": {
"field": "my term field"
}
}
}
},
The system returns total=10000
while the document count in each bucket is about 200k
(significantly greater than the total results). Can I limit the aggregations to only perform over returned results?