0
votes

I am doing a SOLR facetted query, where I want to filter and facet on the same field twice. The scenario is that I am searching for companies and companies have 'labels'. My UI has 2 multiselect dropdowns on the label facet. Selections on the first dropdown are to be AND-ed (companies have ALL of the selected labels) while the choices in the second dropdown are to be OR-ed. Thus a choice of 'A' and 'B' in the first dropdown and a choice of 'C' and 'D' in the second means searching for all companies that have the labels ('A' AND 'B') AND ('C' OR 'D').

The problem is that my facets counts are wrong and the complexity is that I query on label_id, but facet on label_name. So once the user made a selection for the OR multiselect, I add this to my query:

fq={!tag=LABELID_OR}LABELID_MFACET:("9" OR "18")
facet.field=LABELNAME_MFACET    <-- from the AND filter
facet.field=LABELID_MFACET      <-- from the AND filter
facet.field={!key=LABELNAME_OR ex=LABELID_OR}TAGNAME_MFACET

But once I make a single choice the OR filter, the counts drop to zero (0). So the exclusion seems not to work?

1
I even changed the query to query and facet on the same field (LABELNAME_FACET), but it doesn't work out.JointEffort

1 Answers

0
votes

Ok, everything works fine, it was the UI that caused the problem. Shame on me.