lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanjan, Harinder" <>
Subject Faceting with a multi valued field
Date Tue, 25 Sep 2018 20:14:47 GMT

I am doing faceting on a field which has multiple values and it's yielding expected but undesireable
results. I need different behaviour but not sure how to formulate a query for it. Here is
my current setup.

===== Data Set =====
"Communities":["BANFF TRAIL - BNF", "PARKDALE - PKD"],
"Document Type":"Engagement - What We Heard Report",
"Communities":["BANFF TRAIL - BNF", "PARKDALE - PKD"],
"Document Type":"Engagement - What We Heard Report",
"Communities":["SUNALTA - SNA"],
"Document Type":"Engagement - What We Heard Report",

===== Query I run now =====

===== Results I get now =====
        "BANFF TRAIL - BNF",2,
        "PARKDALE - PKD",2,
        "SUNALTA - SNA",0]},

Notice that the Communities facet has 2 non zero results. I understand this is because I'm
using fq to get only documents which contain BANFF TRAIL but those documents also contain

Now, I am using facets to drive navigation on my page. The business case is that user can
select a community to get documents pertaining to that specific community only. This works
with the query I have above. However, the facets results also contain other communities which
then get displayed to the user. For example, with the query above, user will see both BANFF
TRAIL and PARKDALE as selected values even though user only selected BANFF TRAIL. It's worthwhile
noting that I have no control over the data being sent to Solr and can't change it.

How can I formulate a query to ensure that when user selects BANFF TRAIL, only BANFF TRAIL
is returned under Solr facets?


This communication is intended ONLY for the use of the person or entity named above and may
contain information that is confidential or legally privileged. If you are not the intended
recipient named above or a person responsible for delivering messages or communications to
the intended recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying of
this communication or any of the information contained in it is strictly prohibited. If you
have received this communication in error, please notify us immediately by telephone and then
destroy or delete this communication, or return it to us by mail if requested by us. The City
of Calgary thanks you for your attention and co-operation.
View raw message