ElasticSearch-如何将Map字段从关键字更新为文本

rkttyhzu  于 2022-12-17  发布在  ElasticSearch
关注(0)|答案(1)|浏览(141)
{
   "properties":{
      "device":{
         "type":"object",
         "properties":{
            "id":{
               "type":"keyword"
            },
            "value":{
               "type":"keyword"
            }
         }
      }
   }
}

我想将Map值更新为文本,当我尝试使用https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html更新时抛出错误。“不同类型的Map器[设备.值],current_type [关键字],merged_type [文本]”

{
   "properties":{
      "device":{
         "type":"object",
         "properties":{
            "id":{
               "type":"keyword"
            },
            "value":{
               "type":"text"
            }
         }
      }
   }
}

有人帮我更新索引从关键字到文本?

3hvapo4f

3hvapo4f1#

更改字段类型是一项重大更改,您需要
1.使用新的必需Map创建新索引。
1.使用reindex API将数据从旧索引移动到新索引(如果您不介意数据丢失,则为可选)

相关问题