The incorrect results occurred because of wrong parameter naming, I was using order (the one from SQL) instead of sort (Solr convention) to change the order of the results from the Solr web-service. My conclusion that Solr (or Lucene) does not use haversine as a geodist implemenation. &start0 &rows10 &sortgeodist()+asc &sfieldlocation &pt53.6. and made this testing script (full source code and data). SOLR search field type of textCollection and Coordinates are not. My Solution: I said OK it's handy to create a function comparison to see if I made a mistake in my port to the data, I dug into Solr code and extracted the literal implementation of havesine in ., and the result was almost identical. If you.132Mile instead of 83Mile), that's not a difference I can tolerate. geofilt, bbox, geodist, and a range-query with it (which wasnt so when. So when I re-calculate the distance in PHP it results a inconsistent data distances (e.g. This reference guide describes Apache Solr, the open source solution for search. The problem is: Solr calculate the distance in different formula that I couldn't find. I ported the function to PHP (easy!), and made sure that it give correct result. I read the docs and the geodist should be a function that implements the haversine function of geo distance between 2 lat/lng points. However since Solr 3.4 lacks the ability to return function results in the data I had to calculate it manually (by PHP in this case). in the index: geodist() On this query: http://localhost:8983/solr/tt/select/. Search API Location covers a lot of the ground, but out of the box it only works for single-value location fields provided by the Geofield module. I'm having a problem with Solr 3.4, I'm using it's spacial search functions likeĮverything seems ok and the results are return supposedly sorted by distance form a given center point. geodist() spatial sorting: sort param could not be parsed as a query. Recent versions of Solr support proximity search on multi-value geo fields, but no Drupal module I could find takes advantage of that capability.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |