insightful
insightful

Reputation: 189

Solr multiple filter tagging / excluding

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?

Upvotes: 8

Views: 11714

Answers (3)

Daniel W.
Daniel W.

Reputation: 32280

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}

Upvotes: 8

Sarthak Dudhara
Sarthak Dudhara

Reputation: 169

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

Upvotes: 2

Omnaest
Omnaest

Reputation: 3096

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!

Upvotes: 1

Related Questions