This PR address #227, where location.lat and location.lon values are not being returned in a fields search because they are explicitly being excluded from the field_types and the error checker kicks out the request.
The above issue mentions excluding lat and lon was done on a special case for the location field (necessary for geo search by distance?), however, I don't see any issue that keeping lat/lon has an affect on a distance search.
Additionally, in order to store and index the lat and lon so as to return them in a fields filter query, we need to set the lat_lon mapping option for the location field's geo_point type. The lat_lon option will then index these values as fields.
Also needed to update a couple tests that we're expecting lat/lon to not be able to return results as well as added a test for a field filter query to return coordinates.
This PR address #227, where
location.lat
andlocation.lon
values are not being returned in a fields search because they are explicitly being excluded from the field_types and the error checker kicks out the request.The above issue mentions excluding
lat
andlon
was done on a special case for the location field (necessary for geo search by distance?), however, I don't see any issue that keeping lat/lon has an affect on a distance search.Additionally, in order to store and index the
lat
andlon
so as to return them in a fields filter query, we need to set thelat_lon
mapping option for thelocation
field's geo_point type. Thelat_lon
option will then index these values as fields.Also needed to update a couple tests that we're expecting lat/lon to not be able to return results as well as added a test for a field filter query to return coordinates.