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 "Spencer, Dave" <da...@lumos.com> on 2002/09/12 01:28:06 UTC

Is just "-foo" a valid query?

How do I find all the docs without single term e.g. "what docs do not
mention the word 'foo'".

The query "+foo" returns all docs w/ foo, and one would think that a
search on "-foo" would do the
job, however I get zero docs back when searching like this. 
I'm using 1.2. 
Is there something wrong w/ the query execution?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is just "-foo" a valid query?

Posted by Minh Kama Yie <mi...@nuix.com.au>.
Dave,

Unfortunately using the "NOT" operator with a single term does not work as
explained in http://jakarta.apache.org/lucene/docs/queryparsersyntax.html

If you need to do this, create a global index that has the same value for
all documents and use the not operator in addition to this index when
searching.

Minh

----- Original Message -----
From: "Spencer, Dave" <da...@lumos.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Thursday, September 12, 2002 9:28 AM
Subject: Is just "-foo" a valid query?



How do I find all the docs without single term e.g. "what docs do not
mention the word 'foo'".

The query "+foo" returns all docs w/ foo, and one would think that a
search on "-foo" would do the
job, however I get zero docs back when searching like this.
I'm using 1.2.
Is there something wrong w/ the query execution?

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>