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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ