lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmytro Barabash <d.barab...@gmail.com>
Subject Re: Spatial search: collect distances
Date Wed, 30 Mar 2011 12:18:55 GMT
I am sorry to trouble, problem solved (in fact problem is absent :) ).
Calculated distances saved in ScoreDoc (actually  FieldDoc).

2011/3/30 Dmytro Barabash <d.barabash@gmail.com>:
> 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!
> Dmytro
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message