elasticsearch - 错误MergeMappingExcemption失败

标签 elasticsearch

尝试更新服务器上的u映射时遇到问题。我需要在 map 上添加一些字段。在这个问题上,我指望您的帮助。

我正在尝试更新 map :

curl -XGET http://x.xxx.xx.xx:9200/allek/_mapping/auctions?pretty
{
  "allek" : {
    "mappings" : {
      "auctions" : {
        "_all" : {
          "enabled" : false
        },
        "properties" : {
          "cat" : {
            "type" : "long",
            "store" : true
          },
          "curr" : {
            "type" : "string",
            "index" : "not_analyzed",
            "store" : true
          },
          "end_date" : {
            "type" : "long",
            "store" : true
          },
          "price" : {
            "type" : "long",
            "store" : true
          },
          "start_date" : {
            "type" : "long",
            "store" : true
          },
          "tcat" : {
            "type" : "long",
            "store" : true
          },
          "title" : {
            "type" : "string",
            "store" : true
          },
          "uid" : {
            "type" : "long",
            "store" : true
          }
        }
      }
    }
  }

吨 map :
{
  "_all": {
    "enabled": false
  },
  "properties": {
    "cat": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "curr": {
      "index": "not_analyzed",
      "store": true,
      "type": "string",
      "doc_values": true
    },
    "end_date": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "price": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "start_date": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "tcat": {
      "store": true,
      "type": "long",
      "doc_values": true
    },
    "title": {
      "store": true,
      "type": "string",
      "fields": {
        "raw": {
          "type": "string",
          "index": "not_analyzed",
          "ignore_above": 256,
          "doc_values": true
        }
      }
    },
    "uid": {
      "store": true,
      "type": "long",
      "doc_values": true
    }
  }
}

但是我得到消息:
{"error":"MergeMappingException[Merge failed with failures {[mapper [uid] has di
fferent doc_values values, mapper [end_date] has different doc_values values, ma
pper [cat] has different doc_values values, mapper [start_date] has different do
c_values values, mapper [curr] has different doc_values values, mapper [price] h
as different doc_values values, mapper [tcat] has different doc_values values]}]
","status":400}

我究竟做错了什么 ?

为了能够执行此操作,我必须重新索引数据并删除旧 map 并仅添加新 map ?

最佳答案

由于doc_values默认为false,因此在更新中将其设置为true时,会与现有映射产生冲突。
您唯一的选择是重新索引。

关于elasticsearch - 错误MergeMappingExcemption失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38122118/

相关文章:

java - SearchContextMissingException 无法执行提取阶段 [search/phase/fetch/id]

elasticsearch - 在字段名称中使用通配符的Elasticsearch范围查询

elasticsearch - 在Elasticsearch中替代_timestamp

elasticsearch - 当对它进行过滤时,ElasticSearch将我的_id字段加倍

json - 如何批量更改Elastic Search的JSON格式

authentication - 如何禁用 elasticsearch 5.0 身份验证?

c# - C#Nest Elasticsearch:如何搜索多个参数

amazon-web-services - 通过 HTTPS 从 Lambda 连接到 VPC 内的 AWS Elasticsearch

search - 使用 elasticsearch 集群和 Web 服务器集群避免单点故障的最佳方法

php - ES:匹配 bool 值和模糊查询