lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rasik Pandey <>
Subject Efficient Sorting of Hits/Results Using an Encoded Date Field
Date Wed, 13 Apr 2005 19:50:13 GMT

I was wondering if there is a date sort implementation which is more
efficient than just sorting dates as encoded Strings or as custom
Comparable objects. If there isn't I have quickly built one based upon
Tim's SortComparatorSource interface. I would be glad to share it if
there is enough interest. Bascially, using an custom implementation of
SortComparatorSource (DateSortComparator) for value comparison,
String-encoded Date values are decoded to "long" values using the
method "stringToTime" from either the DateField or DateTools class and
stored into a DecodedLongFieldCacheImpl.  The only thing I don't
understand is the the association of the SortField.CUSTOM type to any
SortComparatorSource passed into the SortField Constructor "public
SortField (String field, SortComparatorSource comparator)". It seems
like the SortField.CUSTOM "type" handling in the "switch" statements
of FieldDocSortedHitQueue.lessThan() method  are incongruent with the
idea that a low-level custom SortComparatorSource can be created which
does native type comparisons rather can using the generic


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

View raw message