lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tri Cao <>
Subject Re: How to search for terms containing negation
Date Mon, 17 Mar 2014 19:35:14 GMT

First make sure that your analyzers (both index and query analyzers) do not filter out these
as stop words. I think the standard StopFilter list has "no" and "not". You can try to see
if you index have these terms by querying for "no" as a TermQuery. If there is not match for
that query, then you know for sure they have been filtered out.

The next thing is to check is your query parser. What query parser are you using? Some parser
actually understands the "not" term and rewrite to a negation query.

Hope this helps,

On Mar 17, 2014, at 12:02 PM, Natalia Connolly <> wrote:

Hi All,

Is there any way I could construct a query that would not automatically
exclude negation terms (such as "no", "not", etc)? For example, I need to
find strings like "not happy", "no idea", "never available". I tried
using a simple analyzer with combinations such as "not AND happy", and
similar patterns, but it does not work.

Any help would be appreciated!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
    • Unnamed multipart/related (inline, None, 0 bytes)
View raw message