I have a mapping like below:
{
"my_locations": {
"aliases": {
},
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
I know that if the field type of location is "geo_point" then I can use following geo distance query.
GET /my_locations/_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"location" : {
"lat" : 40,
"lon" : -70
}
}
}
}
}
}
I read that I cannot change the field type for location from text to geo_point(from elastic search documentation and stackoverflow) and I already have many data. So how can I find the location that are within the certain range from my input location?
geo_point