Pure negation query in lucene

In many information-retrieval system, you can use queries like “term1 AND (NOT term2)” but you cannot use queries like “NOT term2” on their own (e.g. to get only documents that do not contain term2). At least the system returns no result even if some documents do not contain term2. This is because:

Despite the difficulties, users of some system might need this kind of query. In Lucene, there are two ways to support it:


Revision #1
Created 2008-08-29 17:30:34 UTC by Chan, Wing Kai
Updated 2008-08-29 17:30:34 UTC by Chan, Wing Kai