The Search API Location module (7.x-2.x & 8.x-1.x branch) adds the possibility of location based searching to the Search API module.

  • D7: Currently only Apache Solr is supported as the service class.
  • D8: Search API Solr is fully supported.
    To support Elasticsearch connector additional patching may be needed. See #3116153: Add support for geofield mapping back to 8.0.x for more information. While this patch has not been fully tested yet, we cannot guarantee that it will function properly without issues. However, we encourage users who prefer Elasticsearch to give it a try and provide feedback on any problems they encounter so that we can continue to improve the module's compatibility with Elasticsearch in the future.

Requirements D8

  • a content type/entity with a latitude/longitude field (currently geofield is supported, location fields probably work, but I haven't tested it yet)
  • When using SOLR:

Requirements D7

  • 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
    • 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.

    Supported Features

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

    Versions

    7.x-1.x

    Integration of the Location module and Search API.

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

    Please follow README installation guidelines to compile apachesolr with geospatial functionality.

    Developed by Dmitry Olaresko and Anton Paschenko

    7.x-2.x

    See explanation above.
    Sponsored by Mediaraven vzw and CoEfficient.

    8.x-1.x (currently maintained version)

    See explanation above.
    Created in Drupal Code Sprints and enhanced in GSOC by dbjpanda. Mentoring time sponsored by Dropsolid.

Project information

Releases