lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SpatialSearch" by Bill Bell
Date Mon, 05 Sep 2011 17:11:32 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SpatialSearch" page has been changed by Bill Bell:
http://wiki.apache.org/solr/SpatialSearch?action=diff&rev1=68&rev2=69

   . [[http://localhost:8983/solr/select?wt=json&indent=true&fl=name,store&q=*:*&fq=store:[45,-94%20TO%2046,-93]|...&q=*:*&fq=store:[45,-94
TO 46,-93]]]
  
  == geodist - The distance function ==
+ The '''geodist()''' function supports (optional) parameters:
+ 
+  . param1: the sfield
+  . param2: the latitude (pt)
+  . param3: the longitude (pt)
+ 
  '''geodist''' is a function query that yields the calculated distance.  This gives the flexibility
to do a number of interesting things, such as sorting by the distance (Solr can sort by any
function query), or combining the distance with the relevancy score, such as boosting by the
inverse of the distance.
  
  Here's an example of sorting by distance ascending:
@@ -81, +87 @@

  
   . [[http://localhost:8983/solr/select?wt=json&indent=true&fl=name,store&q=*:*&fq={!geofilt}&sfield=store&pt=45.15,-93.85&d=50&sort=geodist()%20asc|...&q=*:*&fq={!geofilt}&sfield=store&pt=45.15,-93.85&d=50&sort=geodist()
asc]]
  
- The geodist() function supports parameters:
-  . param1: the sfield
-  . param2: the latitude (pt)
-  . param3: the longitude (pt)
- 
- This returns the as the score - the closest distance for 2 points that the user wants to
check around.
+ This returns the as the score - the closest distance for 2 points that the user wants to
check near (Denver and San Francisco):
  
   . http://localhost:8983/solr/provs2/select?q={!func}min(geodist(store_lat_lon,37.7,-122.4),geodist(store_lat_lon,39.7,-105))&sort=min(geodist(store_lat_lon,37.7,-122.4),geodist(store_lat_lon,39.7,-105))
asc&fl=city_state,store_lat_lon,score&rows=200
- 
  
  == Returning the distance ==
  <!> [[Solr4.0]]

Mime
View raw message