elasticsearch - Elasticsearch 更新 ignore_above 给出非法参数异常
问题描述
我正在尝试更新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
}
}
},
解决方案
从错误看来,“消息”字段是“文本”数据类型,表示分析的文本,而不是 Json 对象/映射。
当您尝试为“message.keyword”设置映射时,您将消息称为对象,这就是问题所在。
您需要将“消息”更改为多字段,以便同时拥有关键字和文本版本。
推荐阅读
- python - 我在哪里可以找到 k-means 的距离度量?
- javascript - 与 for 和回调挑战异步:
- python - 访问函数外部变量我使用另一种方式但不工作
- android-intent - startService() 中的 Intent 应用程序或活动应使用哪个上下文?
- python - Python Tesseract 西里尔字符问题
- python - ValueError:密文长度必须等于密钥大小
- django - Django模型:在一个查询中获取最后一个ForeignKey
- javascript - ECharts:改变线条颜色。我选了 2 种颜色。两种颜色都显示奇偶风格
- r - 在闪亮的仪表板中嵌入图片
- amazon-web-services - 使用 ECS Fargate 进行服务发现