lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maik Schreiber <blizzy-keyword-lucene_user.f54...@blizzy.de>
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   *   http://www.blizzy.de

GPG public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1F11D713
Key fingerprint: CF19 AFCE 6E3D 5443 9599 18B5 5640 1F11 D713

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message