Reputation: 841
Is there a way to add a filter to a terms
aggregation so I get just the ones starting with certain string?
I'm starting from here:
{
"query": {
"match_all": {}
},
"aggs": {
"address": {
"terms": {
"field": "address"
}
}
}
}
Upvotes: 0
Views: 549
Reputation: 217554
Use the include
or exclude
parameters:
{
"query": {
"match_all": {}
},
"aggs": {
"address": {
"terms": {
"field": "address",
"include": "Main.*" <-- add this
}
}
}
}
Upvotes: 2