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 Scott Farquhar <sc...@atlassian.com> on 2003/09/03 03:10:33 UTC

Default queries to using And

Is it possible to get QueryParser.parse() to parse queries defaulting to
'AND' rather than 'OR'?

Currently if you search for 'A B' that is the same as 'A OR B'.  What I
would like is to default to 'A AND B'.

Apologies for the simple question.  I'm guessing the answer is probably more complex
(like Lucene returning A+B, then A, then B)?  I couldn't find anything in
the FAQ about this.

Cheers,
Scott

Re: Default queries to using And

Posted by Scott Farquhar <sc...@atlassian.com>.
This is what I'm looking for.  Too easy.

Cheers,
Scott

On Tue, Sep 02, 2003 at 09:24:04PM -0400, Erik Hatcher wrote:
> Look at QueryParser.setOperator() (perhaps it was added after your 
> version?)
> 
> 	Erik
> 
> 
> On Tuesday, September 2, 2003, at 09:10  PM, Scott Farquhar wrote:
> 
> > Is it possible to get QueryParser.parse() to parse queries defaulting 
> > to
> > 'AND' rather than 'OR'?
> >
> > Currently if you search for 'A B' that is the same as 'A OR B'.  What I
> > would like is to default to 'A AND B'.
> >
> > Apologies for the simple question.  I'm guessing the answer is 
> > probably more complex
> > (like Lucene returning A+B, then A, then B)?  I couldn't find anything 
> > in
> > the FAQ about this.
> >
> > Cheers,
> > Scott
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org

Re: Default queries to using And

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Look at QueryParser.setOperator() (perhaps it was added after your 
version?)

	Erik


On Tuesday, September 2, 2003, at 09:10  PM, Scott Farquhar wrote:

> Is it possible to get QueryParser.parse() to parse queries defaulting 
> to
> 'AND' rather than 'OR'?
>
> Currently if you search for 'A B' that is the same as 'A OR B'.  What I
> would like is to default to 'A AND B'.
>
> Apologies for the simple question.  I'm guessing the answer is 
> probably more complex
> (like Lucene returning A+B, then A, then B)?  I couldn't find anything 
> in
> the FAQ about this.
>
> Cheers,
> Scott
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org