> 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