lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Gluzberg" <drag...@apache.org>
Subject Re: PLEASE REVIEW: Updated Query Parser Syntax
Date Thu, 16 May 2002 14:41:11 GMT
Wait a sec,

NOT can be used with only one term.

NOT "bye bye"
is a legal query

so is:
-"bye bye"


Either will find all documents which do not contain the phrase "bye bye"

I will write a test.

----- Original Message -----
From: "Peter Carlson" <carlson@bookandhammer.com>
To: "Lucene Developers List" <lucene-dev@jakarta.apache.org>
Sent: Wednesday, May 15, 2002 4:14 PM
Subject: Re: PLEASE REVIEW: Updated Query Parser Syntax


> Good point. I do think there needs to be more clarification that NOT
cannot
> be used as the only term and find any results. That is you can say
>
>     NOT "bye bye" hello
>
> But you cannot say
>
>     NOT "bye bye"
>
> However, I think you you might be wrong in describing the way NOT works
with
> AND and OR.
>
> hello OR NOT "bye bye"
>
> Will find all documents with hello AND do not have "bye bye". That is the
> NOT is always based subtracting its finding from the other search results.
> It never subtracts from the complete set of documents in the index.
>
> So in practice
> hello AND NOT "bye bye" (+hello -"bye bye")
> hello OR NOT "bye bye" (hello -"bye bye")
> hello NOT "bye bye" (hello -"bye bye")
> NOT "bye bye" hello (-"bye bye" hello)
>
> Are all equivalent because there is just one term being found and one
phrase
> being removed. These are not equivalent in the general case.
>
> Does that make sense?
>
> --Peter
>
>
> On 5/15/02 8:26 AM, "Eugene Gluzberg" <drag0n2@apache.org> wrote:
>
> > Sorry, I should have been more clear.
> >
> > As far as I understand, NOT is an unary operator, and applies to the to
the
> > term that follows it.
> > So:
> > NOT "bye bye"
> > is a valid query and will find all documents that do not have the phrase
> > "bye bye"
> >
> > if you want to do find all documents that have the set difference
between
> > hello and "bye bye" you will have to use the query:
> >
> > hello AND NOT "bye bye"
> >
> > Also it follows that,
> > hello NOT "bye bye" is equivalent to:
> > hello OR NOT "bye bye"
> >
> > So the query hello NOT "bye bye" will find all documents that either
have
> > hello OR do not have "bye bye"
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message