lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MB Leasing <>
Subject precision double sortable String
Date Mon, 02 Apr 2007 19:02:58 GMT

I'm trying to turn a double with decimal point
precision fifteen digits to the left into a sortable
String for Lucene (.346210426731253).

NumberTools is for longs so doesn't apply.

In Solr, NumberUtils.double2sortableStr prints
out a literal question mark character '?' .

I tried making it a float first but the formatting
also did not work w/NumberUtils.float2sortableStr.

Interestingly, I was able to write a BigDecimal
helper class, use setScale(15), longValue() then
pass it to NumberTools and get a padded result.

.346210426731253 becomes 000000
1.346210426731253 becomes 000001
2.346210426731253 becomes 000002


Any ideas?


Peter W.

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

View raw message