When at least some of your indexed content includes geospatial (longitude and latitude values), you probably want to take advantage of this data to be able to optimize search results based on a reference location.
In the geospatial data case, you can use the following query function to inject a field (
@distance) which contains the dynamically calculated value of the as the crow flies distance (in meters) between a current position and the location in each item. In the same query, you can add a
@distance field expression to return only items for which the as the crow flies distance is within 1000 meters.
@longitudeare fields available in your index
37.77919, -122.41914are the latitudes and longitude of the current reference position
distanceis the temporary dynamic field injected in each search result