lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmytro Barabash <>
Subject Spatial search: collect distances
Date Wed, 30 Mar 2011 10:35:20 GMT
Hi all!
I need 1) sort search results by distance from some point and 2) show
these distances for end-user together with other document information.
1) is simple – like an example in “Lucene in action”: there are
latitude and longitude fields for each document in index,
MyDistanceComparatorSource (extends FieldComparatorSource) return
MyDistanceScoreDocLookupComparator, which know how to calculate and
compare distances, and MyDistanceComparatorSource pass to Sort’s
constructor. Sorting is fine.
For 2) I probably should write MyCollector – wrapper for
TopFieldCollector, that will collect information about distances.
But how (nice) to get already calculated distances in MyCollector, if
these distances are so deeply (in topFieldCollector.comparator)? Or
maybe this way is wrong?
Thanks in advance!

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

View raw message