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: Tagging Facet Queries -- Urgent Help Required
Date Fri, 28 May 2010 08:47:08 GMT
You've tagged facet queries, but looks like you might want to use the  
"excl"ude capability on your filter queries also.  Filter queries are  
additive, constraining the results further for each one, and by  
default faceting is based off the search results.  Use excl to have  
facets count outside the actual constrained search results.

	Erik

On May 28, 2010, at 4:17 AM, Ninad Raut wrote:

> Hi All,
> I have a use case where I have to tag facet queries.
>
> Here is the code snippet for what I tried:
> query.addFilterQuery("{!tag=NE}med:Blog AND slev:neutral");
> query.addFacetQuery("{!tag=NE key=BLOG}med:Blog AND slev:neutral");
> query.addFilterQuery("{!tag=P}med:Review AND slev:neutral");
> query.addFacetQuery("{!tag=P key=Review}med:Review AND slev:neutral");
>
> The result was {BLOG=0, Review=0}
>
> but when I run separate queries :
>
> query1.addFilterQuery("{!tag=NE}med:Blog AND slev:neutral");
> query1.addFacetQuery("{!tag=NE key=BLOG}med:Blog AND slev:neutral");
> and
> query2.addFilterQuery("{!tag=P}med:Review AND slev:neutral");
> query2.addFacetQuery("{!tag=P key=Forum}med:Review AND slev:neutral");
>
> I get correct results.
> {BLOG=98} and {Forum=830} respectively.
>
> I want to do this in a single query (with multiple facets). Is there  
> some
> other way of tagging facet queries?
>
> Can any one help me with this?
>
> Regards,
> Ninad R


Mime
View raw message