I am referring this Geo Distance Query example given on elastic search documentation.
Version : 5.3
As per tutorial i performed this query to insert data in index
PUT /my_locations/location/1
{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
}
}
}
Then I'm simply trying to apply Geo distance query which is also shown in documentation.
GET /my_locations/location/_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"pin.location" : {
"lat" : 40,
"lon" : -70
}
}
}
}
}
}
But it is showing me this error. "failed to find geo_point field [pin.location]" Other time it showed me this error "field [pin.location] is not a geo_point field".
Do i need to insert this record in a different way or am i missing some arguments in query?