我想过滤掉其字段' A'等于' a',我想要面对这个领域' A'同时,当然不包括以前的过滤器。 我知道你可以把过滤器放在外面。查询以获取未应用该过滤器的构面,例如:
ElasticSearch
{
"query : { "match_all" : { } },
"filter" : { "term : { "A" : "a" } },
"facets" : {
"A" : { "terms" : { "field" : "A" } } //this should exclude the filter A:a
}
}
SOLR
&q=:*:*
&fq={!tag=Aa}A:a
&facet=true&facet.field={!ex=Aa}A
这是非常好的,但如果我有多个过滤器和方面,每个过滤器应该相互排斥,会发生什么? 例如:
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
也就是说,对于方面A我想保留除A:a之外的所有滤波器,对于小平面B除了B:b之外的其他所有滤波器,依此类推。 最明显的方法是进行n个查询(每个n个方面各一个),但我想远离那个。
答案 0 :(得分:1)