lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Indexing floating point number
Date Mon, 30 Oct 2006 17:55:17 GMT
On 10/30/06, KEGan <khoon.ee.gan@gmail.com> wrote:
> Newbie question. How do we index floating point number in Lucene, so that it
> is sortable ? There is a built-in utility class 'NumberTools' which help
> with indexing integer. Does Lucene has the same mechanism for floating point
> number?

You can look at NumberUtils in Solr, it has conversions for
int/long/float/double that make strings that sort correctly (for range
queries as well as sorts).  If you use Solr, these transformations are
automatically applied during indexing and querying depending on the
declared type of the field.

http://svn.apache.org/viewvc/incubator/solr/trunk/src/java/org/apache/solr/util/NumberUtils.java?view=markup

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

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


Mime
View raw message