lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spamsucks" <spamsu...@rhoderunner.com>
Subject Sorting on distance from a long/lat
Date Mon, 20 Nov 2006 19:05:38 GMT
I am successfully able to search for "nearbys" given a longitude and a 
latitude.  The basic summary of how I do this is that I add 1000 to the 
long/lat values and use a RangeFilter in my query.

In my display results, I display the results ordered by distance from the 
original long/lat.  What I do is calulate the distance for every document in 
my result from the original long/lat and perform a sort of the distance.

Doing the sort this way (calculating the distances for all results 
documents) feels like I am being inefficient and wasteful with my CPU 
cycles.  In most cases, I am only displaying the closest 10 documents, but I 
need to calculate the distance for all documents (potentially 1000) in order 
to come up with the 10 closest.

Has anyone wrestled with these questions before?  Is there another approache 
that I can take?

Here is my current working implementation, so you can see what I am 
describing.  The long/lat is stored in a database that I use to build up my 
lucene query/filters
 http://www.visitpa.com/visitpa/visitNearbyActivities.pa?type=dining&name=Color+Me+MineThanks,Phillip


---------------------------------------------------------------------
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