elasticsearch - ElasticSearch-在现有索引上设置doc_values

标签 elasticsearch

根据this article:

It is possible to change the field data format (and the field data settings in general) on a live index by using the update mapping API.



但是当我尝试:
curl -XPUT 'http://es1:123/my_index/my_type/_mapping' -d '
{
    "my_type": {
        "properties": {
            "my_prop": {
                "index": "not_analyzed",
                "fielddata": {
                    "format": "doc_values"
                },
                "type": "string",
                "fields": {
                    "hash": {
                        "type": "murmur3"
                    }
                }
            }
        }
    }
}

我得到:
MergeMappingException[Merge failed with failures {[mapper [my_prop] has different doc_values values]}]

任何的想法?

最佳答案

您需要为索引重新创建映射,并重新索引其中的所有文档。

您没有为该字段启用doc_values:"doc_values": true。但是您希望您的fielddata格式为doc_values。这是不可能的。

为了能够将字段数据格式从更改为 doc_values,反之亦然,您需要启用doc_values:"doc_values": true。但是请注意,即使未启用doc_values,您也​​可以自由更改任何内存格式,这意味着从fstpaged_bytes,反之亦然。

关于elasticsearch - ElasticSearch-在现有索引上设置doc_values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30754704/

相关文章:

java - 安装Elasticsearch 5.5 启动服务失败

java.lang.NoSuchMethodError : io. searchbox.action.Action.getURI()Ljava/lang/String

search - Solr和ElasticSearch的可伸缩性:5000个值的字段

elasticsearch - Elasticsearch 结果不一致

elasticsearch - 使用 go 在 elasticsearch 中进行大量更新

nginx - 如何仅在Kibana中设置身份验证

ruby-on-rails - Rails-如何在searchkick中过滤字符串字段?

elasticsearch - ElasticSearch/Kibana:如何汇总相似类型的页面

elasticsearch - 动态模板 : store object as a plain string

elasticsearch - ElasticSearch中的matchAllQuery()