faceted search - ElasticSearch aggregation: exclude one filter per aggregation -
i want filter out documents field 'a' equal 'a', , want facet field 'a' @ same time, excluding of course of study previous filter. know can set filter 'outside' query in order facets without filter applied, like:
elasticsearch
{ "query : { "match_all" : { } }, "filter" : { "term : { "a" : "a" } }, "facets" : { "a" : { "terms" : { "field" : "a" } } //this should exclude filter a:a } } solr
&q=:*:* &fq={!tag=aa}a:a &facet=true&facet.field={!ex=aa}a this nice, happens if have multiple filters , facets each 1 should exclude each other? example:
filter=a:a filter=b:b filter=c:c facet={exclude filter a:a}a facet={exclude filter b:b}b facet={exclude filter c:c}c that is, facet want maintain filters except a:a, facet b except b:b, , on. obvious way n queries (one per each of n facets), i'd remain away that.
the global scope provides access every document, can add together same filters used main query.
i gave illustration global scope in this related topic
could give feedback performance issue post_filter ?
elasticsearch faceted-search
No comments:
Post a Comment