[英]ElasticSearch Failed to parse mapping
我正在尝试使用 put request http://localhost:9200/songs创建新索引,并具有以下映射
{
"mappings": {
"songs": {
"properties": {
"artist_name": {
"type": "text"
},
"songs": {
"type": "nested",
"properties": {
"name": {
"type": "keyword"
},
"lyric": {
"type": "keyword"
}
}
}
}
}
}
}
Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [songs : {properties={artist_name={type=text}, songs={type=nested, properties={lyric={type=keyword}, name={type=keyword}}}}}]"
json 结构是有效的。 我哪里错了?
您似乎正在使用 ES 版本 7,其中该type
已被弃用,如此处所述:
将您的映射更改为以下内容,它应该可以工作。
PUT <your_index_name>
{
"mappings": {
"properties": {
"artist_name": {
"type": "text"
},
"songs": {
"type": "nested",
"properties": {
"name": {
"type": "keyword"
},
"lyric": {
"type": "keyword"
}
}
}
}
}
}
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.