Mailing List Archive

Can NOT be used with a single Term?
According the Jguru FAQ


Is it possible to find all documents in the index that do not contain a
certain term? In other words, is it possible to make a query such as 'NOT
<term>'?


No, it is not possible to do that with Lucene. Lucene could be modified to
do that, but such queries would be very slow.
c.f. http://marc.theaimsgroup.com/?t=100455365600001&r=1&w=2


--Peter

On 5/16/02 7:41 AM, "Eugene Gluzberg" <drag0n2@apache.org> wrote:

> 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.


--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Can NOT be used with a single Term? [ In reply to ]
I just tried:
-foo
NOT foo

Neither worked.

Otis

--- Peter Carlson <carlson@bookandhammer.com> wrote:
> According the Jguru FAQ
>
>
> Is it possible to find all documents in the index that do not contain
> a
> certain term? In other words, is it possible to make a query such as
> 'NOT
> <term>'?
>
>
> No, it is not possible to do that with Lucene. Lucene could be
> modified to
> do that, but such queries would be very slow.
> c.f. http://marc.theaimsgroup.com/?t=100455365600001&r=1&w=2
>
>
> --Peter
>
> On 5/16/02 7:41 AM, "Eugene Gluzberg" <drag0n2@apache.org> wrote:
>
> > 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.
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-dev-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: Can NOT be used with a single Term? [ In reply to ]
Oops. :(

Could you check in the test into cvs? I was just about to add it to
TestQueryParser

----- Original Message -----
From: "Otis Gospodnetic" <otis_gospodnetic@yahoo.com>
To: "Lucene Developers List" <lucene-dev@jakarta.apache.org>
Sent: Thursday, May 16, 2002 11:54 AM
Subject: Re: Can NOT be used with a single Term?


> I just tried:
> -foo
> NOT foo
>
> Neither worked.
>
> Otis
>
> --- Peter Carlson <carlson@bookandhammer.com> wrote:
> > According the Jguru FAQ
> >
> >
> > Is it possible to find all documents in the index that do not contain
> > a
> > certain term? In other words, is it possible to make a query such as
> > 'NOT
> > <term>'?
> >
> >
> > No, it is not possible to do that with Lucene. Lucene could be
> > modified to
> > do that, but such queries would be very slow.
> > c.f. http://marc.theaimsgroup.com/?t=100455365600001&r=1&w=2
> >
> >
> > --Peter
> >
> > On 5/16/02 7:41 AM, "Eugene Gluzberg" <drag0n2@apache.org> wrote:
> >
> > > 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.
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:lucene-dev-help@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
>
> --
> 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>