Elasticsearch更新ignore_above给出非法的_argument_exception

时间:2019-02-26 12:59:10

标签: elasticsearch

我正在尝试更新索引中的ignore_above的值。我正在将PUT放置在/_mappings/my_type(测试者)身上,像这样的身体:

{
 "properties": {
  "message.keyword": {
    "type": "keyword",
    "ignore_above": 20 
  }
 }
}

它返回:"illegal_argument_exception""reason": "mapper [message] of different type, current_type [text], merged_type [ObjectMapper]"

关于如何解决此问题的任何构想都非常好。

这是我的地图:

"mappings": {
        "tester": {
            "properties": {
                "message": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                        }
                    }
                },

1 个答案:

答案 0 :(得分:0)

从错误看来,“消息”字段看起来是“文本”数据类型,表示分析的文本,而不是Json对象/映射。

当您尝试设置'message.keyword'的映射时,您将message称为对象,这就是问题所在。

您需要将“邮件”更改为multi field,以同时具有关键字和文本版本。

相关问题