一、报错:Root mapping definition has unsupported parameters
1、确认ES版本信息
//kibana输入命令
GET /
//得到如下信息
{
"name" : "node-0",
"cluster_name" : "xxx-platform",
"cluster_uuid" : "6cYfmgArS2GXmHsxsSw0Eg",
"version" : {
"number" : "6.8.0", //版本信息
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "65b6179",
"build_date" : "2019-05-15T20:06:13.172855Z",
"build_snapshot" : false,
"lucene_version" : "7.7.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
2、创建索引employee01
PUT /employee01
{
"mappings": {
"properties": {
"name": {
"type": "text"
},
"age": {
"type": "integer"
}
}
}
}
//报错如下
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [name : {type=text}] [age : {type=integer}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [name : {type=text}] [age : {type=integer}]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [name : {type=text}] [age : {type=integer}]"
}
},
"status": 400
}
正确的创建方式如下:文章来源地址https://www.toymoban.com/news/detail-785714.html
PUT /employee01
{
"mappings": {
"xxx": { ----------------区别所在
"properties": {
"name": {
"type": "text"
},
"age": {
"type": "integer"
}
}
}
}
}
文章来源:https://www.toymoban.com/news/detail-785714.html
到了这里,关于ES创建索引出现的错误的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!