lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Stein" <>
Subject Numbertools and efficient sorting
Date Fri, 09 Jun 2006 17:01:27 GMT
I have an integer field that I've indexed after converting to a string
using NumberTools.longToString().
Now I want to sort my results using this field.  Everything works when
treating the field as a string, but is very slow and memory intensive.

I want to use INT sorting instead, but these strings can not be parsed
back into integers by Java's built in parsing functions, which is
presumably what is called when Lucene does its sorting.  They require

My plan is to reindex and zero pad the number myself instead of using
NumberTools.  Is there a way to accomplish what I'm trying to do
without reindexing?

Thanks for any suggestions.

For those of you unfamiliar with the output of numberTools, strings
are stored as follows:

Number 0 converts to 00000000000000
Number 1 converts to 00000000000001
Number 2 converts to 00000000000002
Number 8 converts to 00000000000008
Number 9 converts to 00000000000009
Number 10 converts to 0000000000000a
Number 11 converts to 0000000000000b
Number 34 converts to 0000000000000y
Number 35 converts to 0000000000000z
Number 36 converts to 00000000000010
Number 37 converts to 00000000000011
Number 44 converts to 00000000000018
Number 45 converts to 00000000000019
Number 46 converts to 0000000000001a
Number 47 converts to 0000000000001b

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

View raw message