You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mike Streeton <mi...@ardentia.co.uk> on 2006/01/03 12:48:25 UTC

Switching default parsing for Or and AND

Is there a way of altering the way lucene parses a default string to use
AND instead of OR, e.g. usually "joe bloggs" is executed as "joe OR
bloggs", is there a flag to change this to "joe AND bloggs" which seems
to be the way most search engines work.

 

Thanks

 

Mike


Re: Switching default parsing for Or and AND

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Mike,

If you construct an instance of QueryParser you can set the default  
operator (see the javadocs).  Important: be sure to construct an  
instance and use the *instance* parse method rather than the  
static .parse method!

	Erik

On Jan 3, 2006, at 6:48 AM, Mike Streeton wrote:

> Is there a way of altering the way lucene parses a default string  
> to use
> AND instead of OR, e.g. usually "joe bloggs" is executed as "joe OR
> bloggs", is there a flag to change this to "joe AND bloggs" which  
> seems
> to be the way most search engines work.
>
>
>
> Thanks
>
>
>
> Mike
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org