在给ES7手动创建索引的时候,会出现 这个异常。
代码如下
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
这个异常是说不能在type类型上创建映射 , 在es7中已经在内部取消了, type。 只不过还保留着基本的语法留着过度,因此需要改成这下面这种方法,把索引下面的类型去掉。
PUT twitter
{
"mappings": {
"properties": {
"type": { "type": "keyword" },
"name": { "type": "text" },
"user_name": { "type": "keyword" },
"email": { "type": "keyword" },
"content": { "type": "text" },
"tweeted_at": { "type": "date" }
}
}
}
就可以解决了
猿来衣舍
这是博主开的淘宝小店,主要经营舒适保暖的服饰,有袜子、主题卫衣、保暖衣。欢迎大家选购。
我们也在着手开发脚手架,到时候会做为商店福利的赠送给老用户
打开淘宝搜索 “猿来衣舍”这四个字就可以搜到小店,希望大家多多支持。
一个人能够走多远,关键在于与谁同行,我用跨越山海的一路相伴,希望得到您用金钱的称赞。