You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by SoupErman <mi...@gmail.com> on 2008/08/05 06:34:52 UTC

Lucene excluding 'not' from search terms

As in the subject title, it seems the word 'not' is being excluded from my
searches. Note the lowercase, it isn't being treated as the boolean operator
'NOT'. For example, given the query "sticks not stones", it parses it as
"+keywords:stick +keywords:stone". Whereas if I use the query "sticks NOT
stones", it parses it as "+keywords:stick -keywords:stone".

Is there a config file or something that lets you set terms to
exclude/include? I'm using the Lucene/Solr combination. I've looked through
the docs and code as much as I can and can't figure out why that particular
term 'not' is being dropped.

Any help is greatly appreciated :)
-- 
View this message in context: http://www.nabble.com/Lucene-excluding-%27not%27-from-search-terms-tp18824451p18824451.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Lucene excluding 'not' from search terms

Posted by Kalani Ruwanpathirana <ka...@gmail.com>.
Hi,

I guess it is with your analyzer.  What is the analyzer you are using? If it
is StandardAnalyzer it drops words like "a", "the", etc. You can use the
SimpleAnalyzer
and check.

(I am not very sure because I am also new to Lucene :)



On Tue, Aug 5, 2008 at 10:04 AM, SoupErman <mi...@gmail.com> wrote:

>
> As in the subject title, it seems the word 'not' is being excluded from my
> searches. Note the lowercase, it isn't being treated as the boolean
> operator
> 'NOT'. For example, given the query "sticks not stones", it parses it as
> "+keywords:stick +keywords:stone". Whereas if I use the query "sticks NOT
> stones", it parses it as "+keywords:stick -keywords:stone".
>
> Is there a config file or something that lets you set terms to
> exclude/include? I'm using the Lucene/Solr combination. I've looked through
> the docs and code as much as I can and can't figure out why that particular
> term 'not' is being dropped.
>
> Any help is greatly appreciated :)
> --
> View this message in context:
> http://www.nabble.com/Lucene-excluding-%27not%27-from-search-terms-tp18824451p18824451.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Kalani Ruwanpathirana
Department of Computer Science & Engineering
University of Moratuwa