The Search API spatial module (7.x-2.x branch) adds the possibility of location based searching to the Search API module.
Currently only Apache Solr is supported as the service class.


  • a content type/entity with a latitude/longitude field (currently geofield is supported, location fields probably work, but I haven't tested it yet)
  • Apache Solr server 3.1+ (I only tested with 3.3 and 3.4, but spatial search is included since 3.1)
  • Current versions of Search API and Search API Solr

Installation and configuration

  • Put the module in sites/all/modules folder.
  • enable the module and any sub-module(s) you want
  • add/modify a Search API index which lies on a Solr server
    • on the index's "Fields" tab: index the field containing the latlng value ("LatLong Pair") and select the "Latitude/longitude" type.
      If you don't see the field, check the "Add related field" form at the bottom of the page (see screenshot 1 and screenshot 2)
    • reindex the index

    Depending on what sub-modules you enabled, additional options will now be available for search pages for that index, or for Views filters and contextual filters on location fields.

    Planned features

    • support for Openlayers maps
    • show the results on a map
    • show the distance to the search point
    • bounding box search



    Integration of the Location module and Search API.

    1. Index location data to Solr
    2. Spatial search by radius

    Please follow README installation guidelines to compile apachesolr with geospatial functionality. Or you can download ready apachesolr from here.

    Developed by Dmitry Olaresko and Anton Paschenko

    7.x-2.x (currently maintained version)

    See explanation above.
    Sponsored by Jeugdwerknet vzw and CoEfficient.

Project Information