Question

Is it possible to get distance returned from a geodist() filter, on a geohash field that has multiple values?

The geosort and the geodist filter are working fine, but I'm trying to get the distance between the query point and a location that was returned in the result.

I've tried http://wiki.apache.org/solr/SpatialSearch#Returning_the_distance The second method which is : //localhost:8983/solr/select?indent=true&fl=name,store&sfield=store&pt=45.15,-93.85&sort=score%20asc&q={!func}geodist()

But it returns weird results, tested with 2 locations it returns score 9979.032, where there is ~33,000 Km between both points in reality?

What is the unit that it uses returning the distance in the score field? I assumed km, but it does not make sense, or the result is bogus, I dunno

Anyhelp would be appreciated, thanks

Was it helpful?

Solution

Solr 3 does not support multi-valued geospatial fields. And you should ignore the "GeoHash" field type in particular; it's been removed from the example schema in Solr 4, by the way. To get multi-valued geospatial fields (including sorting) in Solr 3, you need to use a plugin SOLR-2155 that I developed. Solr 4 has a spatial field based on that technology.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top