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 Tue, 06 Sep 2011 03:10:27 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=75&rev2=76

  == How to combine with a sub-query to expand results ==
  It is possible to filter by other criteria with an OR clause. Here is an example that says
return by Jacksonville, FL or within 50 km from 45.15,-93.85:
  
-  . ...&q=*:*&fq=(state:"FL" AND city:"Jacksonville") OR _query_:"{!geofilt}"&sfield=store&pt=45.15,-93.85&d=50&sort=geodist()
asc
+  . [[[[http://localhost:8983/solr/select?q=*:*&fq=(state:"FL" AND city:"Jacksonville")
OR _query_:"{!geofilt}"&sfield=store&pt=45.15,-93.85&d=50&sort=geodist() asc|...&q=*:*&fq=(state:"FL"
AND city:"Jacksonville") OR _query_:"{!geofilt}"&sfield=store&pt=45.15,-93.85&d=50&sort=geodist()
asc]]
  
  Note: you can't try this example with the example schema since the "state" and "city" fields
haven't been defined.
  
  == How to facet by distance ==
  Faceting by distance can be done using the frange QParser.  Unfortunately, right now, it
is a bit inefficient, but it likely will be fine in most situations:
  
-  . [[http://localhost:8983/solr/select?&q=*:*&sfield=store&pt=45.15,-93.85&facet.query={!frange%20l=0%20u=5}geodist()&facet.query={!frange%20l=5.001%20u=3000}geodist()&wt=xml&facet=true|&q=*:*&sfield=store&pt=45.15,-93.85&facet.query={!frange
l=0 u=5}geodist()&facet.query={!frange l=5.001 u=3000}geodist()]]
+  . [[http://localhost:8983/solr/select?q=*:*&sfield=store&pt=45.15,-93.85&facet.query={!frange%20l=0%20u=5}geodist()&facet.query={!frange%20l=5.001%20u=3000}geodist()&wt=xml&facet=true|&q=*:*&sfield=store&pt=45.15,-93.85&facet.query={!frange
l=0 u=5}geodist()&facet.query={!frange l=5.001 u=3000}geodist()]]
  
  == How to boost closest results (with dismax) ==
  It is possible also boost the query by closest results by combining bf with geodist():

Mime
View raw message