Multiple Filter Solr / Exclusion

I am trying to apply filter tags to search for Solr Tagging_and_excluding_Filters .

The challenge is to apply multiple tags simultaneously (for multiple selection options on the same page). eg

q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&fq={!tag=doc}document:1&facet=on&facet.field={!ex=dt}doctype&facet.field={!ex=doc}document

But for some reason, the exception only works for one filter, and the other is invisible. Is there a problem with my syntax? Can anyone suggest a better method?

+6
source share
3 answers

I have a similar problem to solve, and it seems to work just using a comma to separate excluded tags:

From: http://wiki.apache.org/solr/SimpleFacetParameters#facet.field

Exception filtering is supported for all face types. Both tags and ex local params can specify multiple values, separating them with commas.

So, I think you would use it like: {!ex=doc,dt}

+4
source

This answer may not be timely, but I think this should solve your problem.

Try adding both tags to both ex sentences. I did this, and it worked for me in a similar case.

 q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&fq={!tag=doc}document:1&facet=on&facet.field={!ex=dt,doc}doctype&facet.field={!ex=dt,doc}document 
+2
source

Perhaps the section http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams will help you further than you mentioned.

Respectfully!

+1
source

Source: https://habr.com/ru/post/906638/


All Articles