lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maik Schreiber <>
Subject Re: Parsing The Query: Every document that doesn't have a field containing x
Date Thu, 03 Feb 2005 18:19:15 GMT
> Negating a term must be combined with at least one nonnegated term to return
> documents; in other words, it isn't possible to use a query like NOT term to
> find all documents that don't contain a term.
> So does that mean the above example wouldn't work?

Exactly. You cannot search for "-kcfileupload:jpg", you need at least one 
clause that actually _includes_ documents.

Do you by chance have a field with known contents? If so, you could misuse 
that one and include it in your query (perhaps by doing range or 
wildcard/prefix search). If not, try IndexReader.terms() for building a 
Query yourself, then use that one for search.

Maik Schreiber   *

GPG public key:
Key fingerprint: CF19 AFCE 6E3D 5443 9599 18B5 5640 1F11 D713

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message