lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Custom sorting - memory leaks
Date Mon, 21 Aug 2006 17:38:28 GMT

: > DistanceComparatorSource example in LIA). Assume that the 'specified
: > coordinate' is different for each query. This means a new custom comparator
: > must be created for each query, which is ok. However, Lucene caches the

: Lets suppose another custom sortings - random, using dynamically
: changed values from database, etc. Everytime lucene caches _useless_
: custom comparators and application developer has no any control on it.

I see what you're saying now ... yes, for cases like this it probably
would be useful to a way to prevent the Comparator from being cached ...
perhaps by adding a SortComparatorSource.isCachable() method ... but the
changes you suggested would completely eliminate the ability for Lucene to
cache custom comparators at all -- which owuld be just as bad for many
people as the current behavior is for you.

On a related note: have you considered using FunctionQueries (in teh Solr
code base) to do your distance calculations? ... it's been discussed on
the java-users list a few times ... now that i understand that
DistanceComparatorSource caches the computed distances for each requested
"center" point, FunctionQuery certainly seems like a better way to go.


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

View raw message