Hi, I've not tested it by myself but I think that can take advantage of Solr 4's pseudo fields, by adding something like :
&fl=*,geodist(),score I think you could even pass several geodist() calls with different parameters if you want to have the distance wrt several POIs ^-^ SOLR 4 only. -- Tanguy 2012/8/2 Michael Kuhlmann <k...@solarier.de> > On 02.08.2012 01:52, Anand Henry wrote: > >> Hi, >> >> In SOLR 3.4, while doing a geo-spatial search, is there a way to retrieve >> the distance of each document from the specified location? >> > > Not that I know of. > > What we did was to read and parse the location field on client side and > calculate the distance on our own using this library: > > http://code.google.com/p/**simplelatlng/<http://code.google.com/p/simplelatlng/> > > However, it's not as "nice" as getting the distance from Solr, and > sometimes the distances seem to slightly differ - e.g. when you filter up > to a distance of 100 km, there are cases where the client library still > computes 100.8 km or so. > > But at least, it's working. > > -Kuli >