Alternatively, add a dummy field-value to all documents, like doc.add(Field.Keyword("foo", "bar"))
Waste of space, but allows you to perform negated queries. On Thu, 03 Feb 2005 19:19:15 +0100, Maik Schreiber wrote: >> 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. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]