Spatial Search - Apache Solr Reference Guide - Apache Software Foundation
Solr supports location data for use in spatial/geospatial searches. Using spatial search, you can:
- Index points or other shapes
- Filter search results by a bounding box or circle or by other shapes
- Sort or boost scoring by distance between points, or relative area between rectangles
- Generate a 2D grid of facet count numbers for heatmap generation or point-plotting.
There are three main field types available for spatial search:
LatLonType
and its non-geodetic twinPointType
SpatialRecursivePrefixTreeFieldType
(RPT for short), includingRptWithGeometrySpatialField
, a derivativeBBoxField
RPT offers more features than LatLonType and fast filter performance, although LatLonType is more appropriate when efficient distance sorting/boosting is desired. They can both be used simultaneously for what each does best – LatLonType for sorting/boosting, RPT for filtering. If you need to index shapes other than points (e.g. a circle or polygon) then use RPT.
BBoxField is for indexing bounding boxes, querying by a box, specifying a search predicate (Intersects,Within,Contains,Disjoint,Equals), and a relevancy sort/boost like overlapRatio or simply the area.
Some details that are not in this guide can be found at http://wiki.apache.org/solr/SpatialSearch.
Read full article from Spatial Search - Apache Solr Reference Guide - Apache Software Foundation
No comments:
Post a Comment