lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Negative Filtering (such as for profanity)
Date Wed, 07 Mar 2007 21:41:16 GMT
On Wednesday 07 March 2007 16:07, Greg Gershman wrote:
> I'm attempting to create a profanity filter.  I thought to use a QueryFilter 
created with a Query of (-$#!+ AND -@#$% AND etc).  The problem I have run 
into is that, as a pure negative query is not supported (a query for (-term) 
DOES NOT return the inverse of a query for (term)), I believe the bit set 
returned by a purely negative QueryFilter is empty, so no matter how many 
results returned by the initial query, the result after filtering is always 
zero documents.

It may have been suggested already: you can create a Filter
for the positive Query, and then invert the bits in the BitSet of the Filter
to have negative filtering.

Paul Elschot

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

View raw message