Hey Sergio,

you may find the follwing Blog post interesting.
http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/
(https://issues.apache.org/jira/browse/LUCENE-1732)

But as Zend_Lucene is a pure PHP implementation
you probably won't directly profit from the Spatial Lucene contribution (Apache 
Lucene /java).

Leander


Am 04.01.2011 um 17:49 schrieb Sergio Rinaudo:

> 
> Thank you Mark for your reply.
> So, as I thought, there is no solution doing this work using Lucene?
> 
> Thanks
> 
> Sergio
> 
> 
> 
> 
> 
> 
>> Date: Sat, 1 Jan 2011 19:09:11 -0700
>> From: [email protected]
>> To: [email protected]
>> CC: [email protected]
>> Subject: Re: [fw-general] Distance filtering using Lucene
>> 
>> I don't have any experience with lucene but I do have experience with
>> querying geographic coordinates based on distance. If you were using
>> mysql or postgis you could store the coordinates as a point data type
>> and use a length or distance function to limit the result. Not sure
>> how lucene works but you will probably need to use math to calculate
>> the distance. If your coordinates are in degrees the math will be more
>> complex since a distance of 1 degree is different depending on the
>> direction and where it is. For example, 1 degree north is always the
>> same but one degree west is much farther at the equator than it is
>> nearer the poles. Converting the points to a projection that uses
>> meters instead of degrees would probably make the math easier.
>> 
>> I quickly glanced through the Zend_Search_Lucene docs on querying and
>> didn't see any math functions so you may need to do a search that
>> brings back everything regardless of distance and then do the math
>> separately to filter out everything outside your distance range. I'm
>> sure you have your reasons for using lucene over sql but this could be
>> a reason to use sql instead. You can review the mysql spatial
>> extensions here:
>> http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html
>> 
>> Could you store ids and coordinates in a db, query that for distance
>> and then do a lucene search that's limited to those ids? Using sql for
>> the distance query has the added benefit of using a spatial index for
>> improved performance.
>> 
>> 
>> 
>> 
>> Mark
>> 
>> On Sat, Jan 1, 2011 at 4:32 PM, Sergio Rinaudo <[email protected]> 
>> wrote:
>>> 
>>> Hi all,
>>> if I have the longitude and latitude stored in my lucene documents and I 
>>> want to get all the documents from the index
>>> that are distant of a certain value from another longitude and latitude 
>>> pair, what is the best or good solution to do that?
>>> 
>>> Thanks
>>> 
>>> Sergio
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Have fun or die trying - but try not to actually die.
>                                         


Reply via email to