I am trying to detect by means of a regular expression if the latitude and longitude fields are not valid, but it does not work for me. At this time the values of these 2 fields are string. I was trying to merge latitude and longitude to a single latlng field and then change to the geo_point data type to make queries based on latitude and longitude. Can someone help me with this?
Mapping fields
"latitude": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},"longitude": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},"latlng": {
"type": "geo_point"
}
Error example
This error is returned at the time of merging latitude and longitude to a single latlng type geo_point field
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "illegal longitude value [-435.635894775391] for latlng"
}