There is an attribute in QueryParser that will let you set AND as the
default operator.

victor

----- Original Message ----- 
From: "Dror Matalon" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
Sent: Monday, November 24, 2003 7:33 PM
Subject: StandardAnalyzer defaults to OR on query


> Hi,
>
> >From
> http://jakarta.apache.org/lucene/docs/queryparsersyntax.html
>
> The OR operator is the default conjunction operator. This means that
> if there is no Boolean operator between two terms, the OR operator is
> used.
>
> So "foo bar" is equivalent to "foo OR bar" and will probably return more
> hits than just plain "foo" .
>
> On the other hand when I go to google and type "foo" i get 4 million
> hits, and if I type "foo bar" I get around 1 million hits, which seems
> to indicate that it's equivalent to "foo AND bar" . That's my experience
> of using google that the more keywords you add, the more specific the
> query is, the less documents we get.
>
> Personally, I don't mind too much, I can add the "AND" when I need them
> and Lucene does return the documents that match both terms first. But
> I'm worried that it'll confuse some users who are used to the google
> approach.
>
>
> Regards,
>
> Dror
>
>
>
> -- 
> Dror Matalon
> Zapatec Inc
> 1700 MLK Way
> Berkeley, CA 94709
> http://www.fastbuzz.com
> http://www.zapatec.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to