The Search API spatial module (7.x-2.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 works and is fully tested. Elasticsearch connector should work, but problems may arise as this was not fully tested.
Requirements
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)
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)