lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Solr Wiki] Update of "SpatialSearch" by GrantIngersoll
Date Mon, 05 Apr 2010 14:42:45 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.


  === Numerics ===
  The Trie* fields are perfect for representing lat/lon in two distinct fields.  Additionally,
as of, there is now a !PointType that supports
transparently representing a point in n-dimensional space in a rectangular coordinate system.
 Thus, the !PointType might not be appropriate if distance along a sphere or ellipse are desired.
+ ==== Example ====
+ {{{<fieldType name="location" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
+ ...
+ <field name="store" type="location" indexed="true" stored="true"/>
+ }}}
  === LatLonType ===
- The !LatLonType combines a latitude/longitude point with the characteristics of the !SpatialTileField.
 All input is interpreted as latitude then longitude.
+ The !LatLonType combines a latitude/longitude point with the characteristics of the !SpatialTileField.
 All input is interpreted as latitude then longitude.  The LatLonType can combine both the
features of Spatial Tiles (see below) and filtering by distance.
+ ==== Example ====
+ {{{
+ <fieldType name="latLon" class="solr.LatLonType" start="4" end="15" subFieldSuffix="_latLon"/>
+ ...
+ <field name="store_lat_lon" type="latLon" indexed="true" stored="true"/>
+ }}}
  === Geohash ===
  A geohash is a way of encoding lat/lon into a single field as a String.  As of,
it will be possible to create a geohash via FieldType, simply by passing in a Point (lat,lon).
 Solr will do the work of converting the point to a geohash.
  See and
+ ==== Example ====
+ {{{
+ <fieldtype name="geohash" class="solr.GeoHashField"/>
+ ...
+ <field name="store_hash" type="geohash" indexed="true" stored="false"/>
+ }}}
  === Tiles ===
  (Sometimes called Grids or Tiers or a variety of other things.  See
for discussion)
@@ -61, +85 @@

  A tile is the result of first flattening the world (using a projection) and then dividing
up the world into 2^n grid boxes. Each tile (called "n") covers a particular area of the flattened
earth, and as n grows bigger, so does the tile resolution. That is, 2nd level tile is at a
much coarser resolution than say a tile at level 10 that covers the same area.
  See for the !SpatialTileField, which can
index points into tiles at multiple levels.
+ ==== Example ====
+ {{{
+ <fieldType name="tile" class="solr.SpatialTileField" start="4" end="15" subFieldSuffix="_tiled"/>
+ ...
+ <field name="store_tiles" type="tile" indexed="true" stored="false"/>
+ }}}
  = Indexing =
@@ -73, +105 @@

   1. By the Spatial Filter QParser (!SpatialQParser)  - See
- as in {!sfilt fl=location}&pt=49.32,-79.0&dist=20
   1. Using the "frange" QParser, as in {{{fq={!frange l=0 u=400}hsin(0.57, -1.3, lat_rad,
lon_rad, 3963.205)}}}
+ In practice, for those using Solr's field types above, the Spatial Filter !QParser will
automatically make the correct decision about how best to filter.  If an application needs
a specific type of filtering for performance or other needs, the best bet is to extend the
!FieldType in question with your own needs. 
  = Sorting = 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.
@@ -85, +118 @@ See
+ = Known Issues =
+ There are some underlying issues with Lucene's contrib/spatial related to:
+  * Spatial Tiles and large distances:
+  * Issues around the poles:
  = Useful References =

View raw message