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?

已提問 2 年前檢視次數 603 次
1 個回答
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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南