lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@t-online.de>
Subject Re: RangeQuery on Numeric values
Date Fri, 23 Jul 2004 15:27:49 GMT
On Friday 23 July 2004 16:58, Terence Lai wrote:

> I am currently using Lucene 1.4 Final. I want to construct a query that
> matches a numeric range. I believe that the RangeQuery defined in Lucene
> API uses the string comparision. It does not work for numeric contents.
> Does anyone know how to create a numeric range query?

RangeQuery works for numbers, too, but you have to store them in the index so 
they are sorted correctly when sorted alphabetically. For example, if your 
numbers are between 0 and 1000 you have to store them as strings "0000" to 
"1000".

Daniel


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


Mime
View raw message