lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Stein" <>
Subject Re: Numbertools and efficient sorting
Date Sat, 10 Jun 2006 21:34:05 GMT
On 6/9/06, Chris Hostetter <> wrote:
> : 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
> 1) Take a look at FieldCache.IntParser and
> FieldCache.getInts(IndexReader,String,IntParser) .. you can use it in your
> own custom SortComparatorSource and use it when building your Sort Field.
> 2) unless you are using a MultiSearcher, sorting by a string shouldn't
> take any more tiem then sorting on an int -- String sorting only looks at

Thanks for the reply Hoss, as always.

You hit the nail on the head though: I am using a MultiSearcher.  100+
indexes, each with millions of documents.  The memory usage when
storing the strings is very, very high.

I'll do a little more research about the memory usage and expanding to
more boxes and repost to the list.


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

View raw message