aschaar
(aschaar)
February 15, 2012, 5:51am
1
I would like to only show the facets that are found within the
filter. How can I limit them ? Thanks.
var query = {
"filter":{
"terms":{
"tags.split": ["person","politician"],
"minimum_match": 1
}
},
"facets":{
"tags":{
"terms" : { "field": "tags", "size":20 }
},
},
"sort":[
{ "meta.view_count": "desc" },
{ "meta.answer_count": "desc" }
],
"size": 20
}
Karussell1
(Karussell)
February 15, 2012, 9:07am
2
have a look at "filtered":
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
Peter.
On Feb 15, 6:51 am, Arron asch...@gmail.com wrote:
I would like to only show the facets that are found within the
filter. How can I limit them ? Thanks.
var query = {
"filter":{
"terms":{
"tags.split": ["person","politician"],
"minimum_match": 1
}
},
"facets":{
"tags":{
"terms" : { "field": "tags", "size":20 }
},
},
"sort":[
{ "meta.view_count": "desc" },
{ "meta.answer_count": "desc" }
],
"size": 20
}
kimchy
(Shay Banon)
February 15, 2012, 1:30pm
3
filted query (within the search query element) will cause the facets to only be aggregated to the provided query (which is filtered). If additional filtering is required per specific facet, you can have a facet_filter associated with a facet.
On Wednesday, February 15, 2012 at 11:07 AM, Karussell wrote:
have a look at "filtered":
Elasticsearch Platform — Find real-time answers at scale | Elastic
Bird’s Eye View on ElasticSearch its Query DSL | Karussell
Peter.
On Feb 15, 6:51 am, Arron <asch...@gmail.com (http://gmail.com )> wrote:
I would like to only show the facets that are found within the
filter. How can I limit them ? Thanks.
var query = {
"filter":{
"terms":{
"tags.split": ["person","politician"],
"minimum_match": 1
}
},
"facets":{
"tags":{
"terms" : { "field": "tags", "size":20 }
},
},
"sort":[
{ "meta.view_count": "desc" },
{ "meta.answer_count": "desc" }
],
"size": 20
}