elasticsearch - 如何设置现有的 Elasticsearch 映射,从索引:否到索引:已分析

标签 elasticsearch elasticsearch-plugin

我是 flex 搜索的新手,我想更新索引下的现有映射。我现有的映射看起来像

"load":{
    "mappings": {
        "load": {
            "properties":{
                "customerReferenceNumbers": {
                   "type": "string",
                   "index": "no"
                }
             }
         }
     } 
 }

我想从映射中更新该字段以进行分析,以便可以搜索“customerReferenceNumber”字段。
我正在尝试在Sense插件中运行以下查询,
PUT /load/load/_mapping { "load": {
    "properties": {    
        "customerReferenceNumbers": {
            "type": "string",
            "index": "analyzed"
           }
    }
}}

但是此命令出现以下错误,
MergeMappingException [由于失败而合并失败{[mapper customerReferenceNumbers]具有不同的索引值]

尽管存在与这些映射关联的数据,但在这里我无法理解为什么 flex 搜索不允许我将映射从无索引更新为索引?

提前致谢!!

最佳答案

ElasticSearch不允许这种更改。

而且即使有可能,因为必须重新索引数据才能使用新的映射,使用新映射创建新索引并将数据重新索引到其中的速度也更快。

如果您无法承受任何停机时间,请查看designed for these use casesalias功能。

关于elasticsearch - 如何设置现有的 Elasticsearch 映射,从索引:否到索引:已分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32585210/

相关文章:

elasticsearch - 如何确定 Elasticsearch 的合格主节点数量?

ruby-on-rails - Elasticsearch - 未定义方法 `as_indexed_json'

mongodb - Elasticsearch和MongoDB:5次尝试后未找到river _meta文档

elasticsearch - Elasticsearch将数据分为索引

css - 让我的搜索框更适合移动设备

search - 像这样模糊 (FLT) - ElasticSearch

json - Elasticsearch-如何刷新http://<host>:port/heartbeat-*/_ search中的数据?

elasticsearch - 从elasticsearch Head插件中删除名称相似的索引

elasticsearch - Elasticsearch river-5次尝试后未找到_meta文档

python - 多个字段的模糊性-仅在某些字段上使用模糊性