OpenSearch not creating geo_point field type in new instances

0

There's seems to be an issue creating geo_point field types. We have a process that indexes a latitude and longitude coordinate that used to create a geo_point field type and now it creates two separate fields for the lat/lon as float types. This is a real problem since we can no longer perform geo distance searches. We haven't touched the code that performs the indexing so nothing has changed on our end and we can't even create geo_point field types on old version of Elasticsearch. What's going on and how do we create geo_point field types now?

preguntada hace 2 años603 visualizaciones
1 Respuesta
0

Hi, can you please confirm the version of the Opensearch and maybe an example of data and the query?

I've tried the below using Opensearch 1.3 and it seems to be working as expected...

PUT testindex1
{
  "mappings": {
    "properties": {
      "point": {
        "type": "geo_point"
      }
    }
  }
}

PUT testindex1/_doc/1
{
  "point": { 
    "lat": 40.71,
    "lon": 74.00
  }
}

PUT testindex1/_doc/2
{
  "point": "txhxegj0uyp3"
}

GET testindex1/_search
{
  "query": {
    "geo_bounding_box": { 
      "point": {
        "top_left": {
          "lat": 42,
          "lon": -72
        },
        "bottom_right": {
          "lat": 40,
          "lon": -74
        }
      }
    }
  }
}
AWS
Alex_T
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas