elasticsearch - Elasticsearch 根映射不支持的参数
问题描述
我正在尝试使用如下 PUT 命令在弹性搜索中配置索引,并得到如下错误。我无法弄清楚错误是什么。我正在为 ELK 使用 7.4.2 版本
PUT代码如下:
PUT /myfeed
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"folding": {
"type": "custom",
"tokenizer": "standard",
"char_filter": ["html_strip"],
"filter": ["lowercase", "asciifolding"]
}
}
}
},
"mappings": {
"feed": {
"_all": {
"enabled": false
},
"properties": {
"feed": {
"type": "keyword"
},
"link": {
"type": "keyword"
},
"published": {
"type": "date"
},
"message": {
"type": "string",
"analyzer": "folding"
},
"title": {
"type": "string",
"analyzer": "folding"
}
}
}
}
}
控制台上的错误如下:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
}
},
"status": 400
}
请帮我解决这个问题
解决方案
_all 已弃用,如 Lupanoide 所说(谢谢)所以对我有用的映射如下
PUT /myfeed
{
"mappings": {
"properties": {
"feed": {
"type": "keyword"
},
"link": {
"type": "keyword"
},
"published": {
"type": "date"
},
"message": {
"type": "text",
"analyzer": "folding"
},
"title": {
"type": "keyword"
}
}
},
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"folding": {
"type": "custom",
"tokenizer": "standard",
"char_filter": ["html_strip"],
"filter": ["lowercase", "asciifolding"]
}
}
}
}
}
谢谢
推荐阅读
- java - 在用于 gui 预览的 intellij 中显示类未找到错误
- java - 更新电脑后如何更新 debug.keystore 文件
- angular - 如何在依赖角度的模块上获得多个版本
- delphi - 如何知道产生异常的确切行号
- pytorch - pytorch RuntimeError:预期的类型为 torch.cuda.LongTensor 的对象,但发现类型为 torch.LongTensor 的参数
- swagger - swagger-3.0中multipart request body下的特定表单数据内容,swagger-ui中是否可以有content headers的参数字段?
- java - 如何将 JAVA 对象转换为 HTML 表格?
- gulp - 使用 signalr 包构建项目时找不到模块
- sprite-kit - Flutter SpriteWidget 和 Apple SpriteKit 有什么关系?
- python - 如何像在 3ds max 中一样实现 alt+MMB 相机旋转?