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 GrantIngersoll
Date Wed, 30 Jun 2010 15:48:41 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 GrantIngersoll.
http://wiki.apache.org/solr/SpatialSearch?action=diff&rev1=22&rev2=23

--------------------------------------------------

  ...
  <field name="store_hash" type="geohash" indexed="true" stored="false"/>
  }}}
- 
  = Indexing =
  Indexing is handled by the various !FieldType instances in the schema.  At the most basic,
the user can represent their own spatial data using ints, floats or doubles.  Beyond that,
the !PointType, !GeoHashField and !LatLonType can be used to index spatial information automatically.
  
@@ -89, +88 @@

  
  See !SpatialFilterTest for examples of the various points.
  
+ The following parameters are supported:
+ ||<tablewidth="725px" tableheight="184px" tablestyle="">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
||
+ ||units ||The units of distance.  "mi" or "km".  Default is miles.  All distances are converted
to miles internally. ||&units=km &units=mi ||
+ ||sphere_radius ||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 miles (see org.apache.solr.search.function.distance.Constants.EARTH_MEAN_RADIUS_MI)
which is set to 3,958.761458084784856.  Most applications will not need to set this. ||&sphere_radius=10.3
||
+ ||meas ||NOTE: This value is experimental and subject to removal.  Most applications will
not need to change the measure.  The !FieldTypes usually make the proper choice given the
data stored. The distance measure to use when calculating distance.  The default is dependent
on the FieldType.  Supported values are: 1. hsin - The haversine 2. 0, 1, 2, ... INF for the
appropriate p-norm (2 is the Euclidean Distance) ||&meas=hsin. ||
  
- The following parameters are supported:
  
- ||<tablestyle="width: 725px; height: 184px;">Parameter||Description||Example||
  
- ||<tablestyle="width: 725px; height: 184px;">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)||&d=10.0||
- ||units||The units of distance.  "mi" or "km".  Default is miles.  All distances are converted
to miles internally.||&units=km &units=mi ||
- ||sphere_radius||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 miles (see org.apache.solr.search.function.distance.Constants.EARTH_MEAN_RADIUS_MI)
which is set to 3,958.761458084784856.  Most applications will not need to set this. ||&sphere_radius=10.3||
- ||meas||NOTE: This value is experimental and subject to removal.  Most applications will
not need to change the measure.  The !FieldTypes usually make the proper choice given the
data stored. The distance measure to use when calculating distance.  The default is dependent
on the FieldType.  Supported values are: 1. hsin - The haversine 2. 0, 1, 2, ... INF for the
appropriate p-norm (2 is the Euclidean Distance) ||&meas=hsin.||
  
  == Filtering Caveats ==
- 
  === North/South Poles ==
  
  When the bounding box includes a Pole, then the !LatLonType will automatically switch from
producing a bounding box to a "bounding bowl" (i.e. a spherical cap: http://mathworld.wolfram.com/SphericalCap.html)
whereby it will include all values that are North or South of the latitude of the would be
bounding box (the lower left and the upper right) that is closer to the equator.  In other
words, we still calculate what the coordinates of the upper right corner and the lower left
corner of the box would be just as in all other filtering cases, but we then take the corner
that is closest to the equator (since it goes over the pole it may not be the lower left,
despite the name) and do a latitude only filter.  Obviously, this means there will be more
matches than a pure bounding box match, but the query is much easier to construct and will
likely be faster, too.
- 
  
  = 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