The Spatial-Extras Module for Apache Lucene

The spatial-extras module, new to Lucene 6.5, is the new home for the original lucene spatial module. The principle interface to this module is a {@link org.apache.lucene.spatial.SpatialStrategy} which encapsulates an approach to indexing and searching based on shapes. Different Strategies have different features and performance profiles, which are documented at each Strategy implementation class level.

For some sample code showing how to use the API, see SpatialExample.java in the tests.

The spatial-extras module uses Spatial4j heavily. Spatial4j is an ASL licensed library with these capabilities:

Historical note: The new spatial-extras module was once known as Lucene Spatial Playground (LSP) as an external project. In ~March 2012, LSP split into the spatial module as part of Lucene and Spatial4j externally. A large chunk of the LSP implementation originated as SOLR-2155 which uses trie/prefix-tree algorithms with a geohash encoding. That approach is implemented in {@link org.apache.lucene.spatial.prefix.RecursivePrefixTreeStrategy} today.