On Mar 7, 2010, at 7:45 AM, KshamaPai wrote:

> 
> Hi,
> 
> Inorder to understand - cartessian tiers,how are they contributing in
> location based search - What is happening internally when we give query to
> solr like http://localhost:8983/solr/select/?q=name:Minneapolis AND
> _val_:"recip(hsin(0.78, -1.6, lat_rad, lon_rad, 3963.205), 1, 1, 0)"^100 and
> other functions like ghhsin(),sqedist(),dist() .how is it working to
> retrieve relevent records?
> 

This query says to me:  Find all documents that have the word Minneapolis in 
the name and boost the scores based on not only the term scores (i.e. 
Minneapolis) but also
add in a boost based on 1 over the haversine distance between the point 0.78, 
-1.6 (in radians) and the values contained in the lat_rad and lon_rad fields 
(for each document that matched Minneapolis) and boost that resulting score by 
100.  In other words, 1 over the distance.

The other functions are just different ways of calculating distance.  GHSin is 
the Haversine distance applied to a GeoHash field.  A geohash field encodes 
lat/lon into a single field.  Haversine is generally more accurate for 
measurements on a Sphere.  Dist and sqedist are the traditional distances used 
in a Rectangular Coordinate System (aka the stuff you learned about way back 
when as a kid).  Even Haversine isn't as accurate as one could get, since the 
Earth is not actually a Sphere.  For most situations, however, it is more than 
sufficient.  If you really need the utmost accuracy, you could implement 
Vincenty's formula.  


> Can any one suggest me any link that will help me understand all these
> concepts better.


Here's the Solr wiki page: http://wiki.apache.org/solr/SpatialSearch

Here's an article I wrote on spatial: 
http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html

Reply via email to