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 DanaWhite <ph...@comcast.net> on 2008/08/19 02:34:59 UTC

Simple Query Question

For some reason I am thinking I read somewhere that if you queried something
like:

"Eiffel Tower"

Lucene would execute the query "Eiffel AND Tower"

Basically I am trying to ask, does lucene automatically replaces spaces with
the AND operator?

Thanks
Dana
-- 
View this message in context: http://www.nabble.com/Simple-Query-Question-tp19042444p19042444.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Simple Query Question

Posted by Erick Erickson <er...@gmail.com>.
As Ian says, but you can set the default to AND or OR, see
the API docs.

The 'out of the box' default is OR.

See QueryParser.setDefaultOperator

Best
Erick

On Tue, Aug 19, 2008 at 4:30 AM, Ian Lea <ia...@gmail.com> wrote:

> No, lucene does not automatically replace spaces with AND.
>
> See http://lucene.apache.org/java/2_3_2/queryparsersyntax.html
>
>
> --
> Ian.
>
>
> On Tue, Aug 19, 2008 at 1:34 AM, DanaWhite <ph...@comcast.net> wrote:
> >
> > For some reason I am thinking I read somewhere that if you queried
> something
> > like:
> >
> > "Eiffel Tower"
> >
> > Lucene would execute the query "Eiffel AND Tower"
> >
> > Basically I am trying to ask, does lucene automatically replaces spaces
> with
> > the AND operator?
> >
> > Thanks
> > Dana
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Simple Query Question

Posted by Ian Lea <ia...@gmail.com>.
No, lucene does not automatically replace spaces with AND.

See http://lucene.apache.org/java/2_3_2/queryparsersyntax.html


--
Ian.


On Tue, Aug 19, 2008 at 1:34 AM, DanaWhite <ph...@comcast.net> wrote:
>
> For some reason I am thinking I read somewhere that if you queried something
> like:
>
> "Eiffel Tower"
>
> Lucene would execute the query "Eiffel AND Tower"
>
> Basically I am trying to ask, does lucene automatically replaces spaces with
> the AND operator?
>
> Thanks
> Dana

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