lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <erik.hatc...@gmail.com>
Subject Re: Merging results of facet fields
Date Wed, 04 Jan 2012 13:15:53 GMT
I'd recommend what Andy said, but if all you're interested in is a single term combined, you
can do <facet.query=product:computer OR tag:computer> and you'll get the "merged" count.

	Erik

On Jan 4, 2012, at 07:51 , Andrew Ingram wrote:

> Hi Marc,
> 
> I'd probably have another field called "keywords" (or something) that I copy all the
values into using copyfields, then just facet (and therefore filter) on that field instead.
> 
> If there were a way to do it the way you're asking (there might be, I don't know), there's
no guarantee that the total of 23 is correct. If there's overlap ie a document having both
product and tag values of "computer", the merged total should actually be less than 23.
> 
> - Andy
> 
> On 4 Jan 2012, at 12:45, Marc SCHNEIDER wrote:
> 
>> Hello,
>> 
>> I have two fields 'product' and 'tag'.
>> Executing this query q=*:*&facet=true&facet.field=product&facet.field=tag
>> gives me this result :
>> 
>> <lst name="facet_fields">
>> <lst name="product">
>>    <int name="computer">16</int>
>>    ...
>> </lst>
>> <lst name="tag">
>>    <int name="computer">7</int>
>>    ...
>> </lst>
>> </lst>
>> 
>> Is there a way to group the results by value ie getting <int
>> name="computer">23</int>, regardless of the field names?
>> 
>> Thanks in advance,
>> Marc.
> 
> 


Mime
View raw message