The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true
在給ES7手動(dòng)創(chuàng)建索引的時(shí)候,會(huì)出現(xiàn) 這個(gè)異常。
代碼如下
PUT twitter
{
"mappings": {
"_doc": {
"properties": {
"type": { "type": "keyword" },
"name": { "type": "text" },
"user_name": { "type": "keyword" },
"email": { "type": "keyword" },
"content": { "type": "text" },
"tweeted_at": { "type": "date" }
}
}
}
}
The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true
這個(gè)異常是說不能在type類型上創(chuàng)建映射 , 在es7中已經(jīng)在內(nèi)部取消了, type。 只不過還保留著基本的語(yǔ)法留著過度,因此需要改成這下面這種方法,把索引下面的類型去掉。文章來源:http://www.zghlxwxcb.cn/news/detail-532758.html
PUT twitter
{
"mappings": {
"properties": {
"type": { "type": "keyword" },
"name": { "type": "text" },
"user_name": { "type": "keyword" },
"email": { "type": "keyword" },
"content": { "type": "text" },
"tweeted_at": { "type": "date" }
}
}
}
就可以解決了!文章來源地址http://www.zghlxwxcb.cn/news/detail-532758.html
到了這里,關(guān)于ES7版本索引創(chuàng)建失敗問題處理的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!