lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Problem in lucene query
Date Thu, 10 Sep 2009 12:31:40 GMT
> I am new to Lucene and facing a problem while performing
> searches. I am using lucene 2.2.0.
> My application indexes documents on "keyword" field which
> contains integer values. 

Which analyzer/tokenizer are you using on that field? I am assuming it is a tokenized field.

>If the value is negative the query does not return
> correct results.

Is it returning 1's as well as -1's?

- is a special character so you have to escape it when querying.
So keyword:\-1 is correct. But the problem is StandardTokenizer tokenizes 
-1 to 1. If you use it all -1's and 1's are threated same. Use whitespaceanalyzer instead.

Hope this helps.


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

View raw message