Can anyone guide me to change the mapping type of location to geo_point.?
Service: Aws ElasticSearch (6.2 Version) Database: dynamodb
I am using aws elastic search service to filter values based on my location. As per the documentation i have created a trigger lambda function dbtoEs which is a python code soon after the record is added its indexed.
Since my location type in dynamodb is type Location { lat: Float lon: Float }
When i go to Aws ElasticSearch and check in indices the mapping type for this field is also location { lat float lon float }
As per the Elastic geo distance query (https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl-geo-distance-query.html) the mapping type of location should be geo_point
Example of search query filter
filter:[
{
geo_distance:{
distance:"2000 km",
location:{
lon:77.676,
lat:12.998
},
}
},
{
range:{
createdAt:{
gte:"now-1d/d"
}
}
}
],
Search Response
{
"took":4,
"timed_out":false,
"_shards":{
"total":5,
"successful":4,
"skipped":0,
"failed":1,
"failures":[
{
"shard":4,
"index":"spot",
"node":"*******",
"reason":{
"type":"query_shard_exception",
"reason":"failed to find geo_point field
[location]",
"index_uuid":"**********",
"index":"***"
}
}
]
},
"hits":{
"total":0,
"max_score":null,
"hits":[
]
}
}
**Result Required: Filtered results should be based on location**