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?

feita há 2 anos603 visualizações
1 Resposta
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 há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas