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 "SpatialSearchDev" by Bill Bell
Date Thu, 15 Mar 2012 07:25:51 GMT
Dear Wiki user,

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

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

  = Spatial Search (docs + features under development). =
  Examine SpatialSearch prior to this page if you have not already.
  
- ''''''Solr also supports other spatial capabilities beyond just latitude and longitude.
 For example, a PointType can be used to represent a point in an n-dimensional space.  This
can be useful, for instance, for searching in CAD drawings or blueprints.  Solr also supports
other distance measures.  See the FunctionQuery page for more information and look for hsin,
ghhsin and others.
+ Solr also supports other spatial capabilities beyond just latitude and longitude.  For example,
a PointType can be used to represent a point in an n-dimensional space.  This can be useful,
for instance, for searching in CAD drawings or blueprints.  Solr also supports other distance
measures.  See the FunctionQuery page for more information and look for hsin, ghhsin and others.
  
  == Field Types ==
  === PointType ===
  {{{
  <fieldType name="location" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
  }}}
- 
  ==== Example ====
  {{{
  <fieldType name="latLon" class="solr.LatLonType" subFieldSuffix="_latLon"/>
@@ -72, +71 @@

  
  For !PointType, the bounding box is calculated by standard rectangular coordinate system
measures.
  
+ == GeoHash Plugin ==
+ See [[https://issues.apache.org/jira/browse/SOLR-1568|https://issues.apache.org/jira/browse/SOLR-2155]]
the plugin for Solr 3.x is at [[https://issues.apache.org/jira/secure/attachment/12497800/Solr2155-1.0.3-project.zip]]
+ 
+ ''NOTE: ''The GeoHash Plugin improves performance and allows for a multiValued field for
Lat,Long.
+ 
+ Setup:
+ 
+ 1. Add Field Type in schema.xml:
+ 
+ <fieldType name="geohash" class="solr2155.solr.schema.GeoHashField" length="12" />
+ 
+ 2. Add a field in the <fields> section of schema.xml
+ 
+  <field name="store_geohash" type="geohash" indexed="true" stored="true" '''multiValued="true"'''/>
+ 
+ 3. In your solrconfig.xml
+ 
+       Top level within <config>, suggested to place at bottom:
+         <!-- an alternative query parser to geofilt() (notably allows a specific lat-lon
box) -->
+         <queryParser name="gh_geofilt" class="solr2155.solr.search.SpatialGeoHashFilterQParser$Plugin"
/>
+         <!-- replace built-in geodist() with our own modified one -->
+         <valueSourceParser name="geodist" class="solr2155.solr.search.function.distance.HaversineConstFunction$HaversineValueSourceParser"
/>
+ 
+       Add the following cache into <query> section if you are going to use geodist
func
+           <cache name="fieldValueCache"
+             class="solr.FastLRUCache"
+             size="10"
+             initialSize="1"
+             autowarmCount="1"/>
+ 
+ The following parameters are supported for {!geofilt}:
+ 
+ ||<tablewidth="725px" tableheight="184px">Parameter ||Description ||Example ||
+ ||pt ||The Point to use as the center of the filter.  Specified as a comma separated list
of doubles.  If using the !LatLonType, then it is lat,lon. ||&pt=33.4,29.0 &pt=27.3,83.9,10.0,5.5
||
+ ||d ||The distance from the point to the outer edge   of whatever is being used to filter
on (bounding box, pure distance,   something else).  Must be greater than or equal to 0 ||&d=10.0
||
+ ||sfield ||The radius of the sphere to be used when   calculating distances on a sphere
(i.e. haversine).  Default is the   Earth's mean radius in kilometers (see org.apache.lucene.spatial.DistanceUtils.EARTH_MEAN_RADIUS_KM)
which is set to 6371.009.  Most applications will not need to set this. ||&sfield=store_geohash
||
+ 
+ 
  = Sorting =
  https://issues.apache.org/jira/browse/SOLR-1297  added the ability to sort by function,
so sorting by distance is now  simply a matter of sorting using the appropriate distance function,
just  like boosting.
  

Mime
View raw message