It seems that there is something in latest Solr version that you might be able 
to use. From release notes:

“The new facet.matches parameter returns facet buckets only for terms
that match a regular expression.”

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 21 Dec 2017, at 18:45, Erick Erickson <erickerick...@gmail.com> wrote:
> 
> You might be able to do some interesting with the JSON faceting
> approach, but I confess I don't know for sure.
> 
> Best,
> Erick
> 
> On Thu, Dec 21, 2017 at 8:17 AM, Shawn Heisey <apa...@elyograg.org> wrote:
>> On 12/20/2017 2:40 PM, Arun Rangarajan wrote:
>>> 
>>> I think multi-select faceting does the opposite of what I want. I want the
>>> facet to include the filters.
>> 
>> 
>> You don't have any filters to include or exclude.  You would need fq
>> parameters to use multi-select faceting.  But as you say, it doesn't do what
>> you want anyway.
>> 
>> <snip>
>> 
>>> As you can see, hierarchy and interests are both multi-valued string
>>> fields.
>>> 
>>> I want pivot facet counts for the two fields: hierarchy and interests, but
>>> filtered for only two values of interests field: hockey, soccer.
>> 
>> 
>> <snip>
>> 
>>> The counts for hockey and soccer are correct. But I am also getting the
>>> facet counts for other values of interests (like tennis, futbol, etc.,)
>>> since these values match the query. I understand why this is happening.
>>> This is why I said I want to do something like
>>> 
>>> https://lucene.apache.org/solr/guide/6_6/faceting.html#Faceting-Limitingfacetwithcertainterms
>>> for facet pivots. Is there a way to do that?
>> 
>> 
>> I see now.  It's showing the other values because the fields are multivalued
>> and the matching documents actually do contain those values, so Solr is
>> working the way I expected it to, but your data is different than I was
>> thinking.  It's the multivalued aspect that makes this problematic.
>> 
>> I was not aware that you could limit the terms with field faceting. Either
>> the syntax to achieve what you want is different than what you are using, or
>> it just can't be done with pivot faceting at the moment because there are no
>> options to do it.  I'm guessing the latter, but since I am not familiar with
>> the code, I cannot say for sure.  Hopefully somebody else can speak up with
>> an option, but I'm not expecting that to happen.
>> 
>> Thanks,
>> Shawn

Reply via email to