I want to filter documents whose field "A" is equal to "a", and I want an aspect of field "A" at the same time, excluding, of course, the previous filter. I know that you can put a filter βoutsideβ the query to get faces without applying this filter, for example:
Elasticsearch
{ "query : { "match_all" : { } }, "filter" : { "term : { "A" : "a" } }, "facets" : { "A" : { "terms" : { "field" : "A" } } //this should exclude the filter A:a } }
GUMZ
&q=:*:* &fq={!tag=Aa}A:a &facet=true&facet.field={!ex=Aa}A
This is very nice, but what happens if I have several filters and faces that each 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, for face A, I want to save all filters except A: a, for facet B, except B: b, and so on. The most obvious way would be to make n queries (one for each of the n aspects), but I would like to avoid this.
source share