I am trying to apply filter tagging for Solr search Tagging_and_excluding_Filters.
The challenge is to apply multiple tagging at the same time (for multiple select options on a single page). e.g.
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 excluding works only for one filter and other gets unnoticed. Is there any problem with my syntax? Can anyone suggest a better method?
I'm having a similiar problem to solve and it seemed to work by just using a comma to seperate excluded tags:
From: http://wiki.apache.org/solr/SimpleFacetParameters#facet.field
Filter exclusion is supported for all types of facets. Both the tag and ex local params may specify multiple values by separating them with commas.
So I guess you'd use it like: {!ex=doc,dt}
This answer may not be timely, but i think this should resolve your issue.
Try adding both the tags in both the ex clauses. I did that and it worked for me for 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
Possibly the http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams section would help you further than the from you mentioned one.
Best regards!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With