Reputation: 41078
Consider this good request using facets:
{
"facets": {
"tag": {
"terms": {
"field": "text"
},
"facet_filter": {
"term": {
"lang": "en"
}
}
}
}
}
How can I switch to aggregations
instead of facets
with the facet_filter feature?
{
"aggs": {
"tag": {
"terms": {
"field": "text"
},
"facet_filter": { <--- Not working
"term": {
"lang": "en"
}
}
}
}
}
Upvotes: 1
Views: 314
Reputation: 3411
You can use a filter
{
"aggs": {
"tag": {
"filter" : { "term" : { "lang" : "en" } },
"aggs" : {
"tag": {
"terms" : { "field" : "text" }
}
}
}
}
}
Here's the request and response: http://yaap.it/paste/14031049226e045a#jiVNZCVxVK++UJJMeBYcylIg1I7S2UNOExBxymlYpAo=
Upvotes: 3