You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by prerna07 <pk...@sapient.com> on 2009/06/19 08:37:37 UTC

Default AND operator | search on multiple fields

Hi,

I want to perform search with default AND operator on multiple fields.

Below mentioned query works fine with AND operator and one field :
?q={!lucene q.op=AND df=prdMainTitle_product_s}Ladybird Shrinkwrap

However as soon as I add two fields, it starts giving  me records which have
two terms "LadyBird" and "Shrinkwrap" but in multiple fields, however it
should search only in prdMainTitle_product_s and prdMainSubTitle_product_s

?q={!lucene q.op=AND qf=prdMainTitle_product_s
qf=prdMainSubTitle_product_s}Ladybird Shrinkwrap&qt=dismaxrequest


Please let me know if there are issues with the query above.

Thanks,
Prerna



-- 
View this message in context: http://www.nabble.com/Default-AND-operator-%7C-search-on-multiple-fields-tp24106288p24106288.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Default AND operator | search on multiple fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 19, 2009, at 2:37 AM, prerna07 wrote:

>
> Hi,
>
> I want to perform search with default AND operator on multiple fields.
>
> Below mentioned query works fine with AND operator and one field :
> ?q={!lucene q.op=AND df=prdMainTitle_product_s}Ladybird Shrinkwrap
>
> However as soon as I add two fields, it starts giving  me records  
> which have
> two terms "LadyBird" and "Shrinkwrap" but in multiple fields,  
> however it
> should search only in prdMainTitle_product_s and  
> prdMainSubTitle_product_s
>
> ?q={!lucene q.op=AND qf=prdMainTitle_product_s
> qf=prdMainSubTitle_product_s}Ladybird Shrinkwrap&qt=dismaxrequest
>
>
> Please let me know if there are issues with the query above.

The lucene query parser does not support qf.  Only a single default  
field (df) is supported, and all unqualified clauses use that default  
field.

	Erik