首页 文章

弹性搜索索引映射更新

提问于
浏览
0

我使用的是ES-2.4.0
索引json:
{ "_id": 1, "name": "Longsword", "description": "The Longsword can be wielded in one or two hands", "category": "Sharp" }

1.我创建了一个索引,正在创建默认映射 .
2.现在我正在尝试更新此处建议的映射 .

链接:https://gist.github.com/nicolashery/6317643

关于 point 1 : i have not used any analyzer ;
关于 point 2 : i am using analyser "not_analysed" ;

但它没有用 .

Question : Has ES-2.X stopped mapping updation facility if not how can i update the mapping ?

注意:尝试我收到此错误

{“error”:{“root_cause”:[{“type”:“illegal_argument_exception”,“reason”:“[name]的映射器与其他类型的现有映射冲突:\ n [mapper [name]有不同的[analyzer] ]]“}],”type“:”illegal_argument_exception“,”reason“:”[name]的映射器与其他类型的现有映射冲突:\ n [mapper [name]有不同的[analyzer]]“},”status “:400}

1 回答

  • 2

    不,不允许更改现有字段的映射类型 ES 2.x .

    来自documentation

    通常,无法更新现有字段的映射 . 这条规则有一些例外 . 例如:可以将新属性添加到Object数据类型字段 . 可以将新的多字段添加到现有字段中 . doc_values可以被禁用,但不能启用 . ignore_above参数可以更新 .

    您必须首先delete the index并使用新映射创建一个新的 . 还有一个小错字,它是 not_analyzed ("z"不是"s")

相关问题