lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject Re: Search Query (Should I use fq)
Date Fri, 30 Dec 2011 08:18:33 GMT
> I am looking to write a query in
> which a user will enter two conditions i.e. 
>                
>   Search for description:<text> where
> category:<someCategory>
> 
> So whats the best way to query it
> 
> 1. q = (description:text) AND (category:someCategory)
> 
> or
> 
> 2. q = (description:text) AND (fq=category:someCategory)
> 
> or Is there a better way then the ones written above ?

Your second example is invalid actually. Correct syntax is :
&q=description:text&fq=category:someCategory

It seems that fq is more appropriate for category:someCategory, if that query would possibly
be issued again.  Filter queries are cached. 
http://wiki.apache.org/solr/CommonQueryParameters#fq

Mime
View raw message