我正在关注版本6.0的elasticsearch指南:https: //www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html
1]创建映射
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" }
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
2]创建文档.
PUT twitter/_doc/user-kimchy
{
"type": "user",
"name": "Shay Banon",
"user_name": "kimchy",
"email": "shay@kimchy.com"
}
Run Code Online (Sandbox Code Playgroud)
什么是1和2中的"_doc"?考虑到类型远离Elasticsearch 6.0.0的事实
提前致谢 !!
| 归档时间: |
|
| 查看次数: |
1162 次 |
| 最近记录: |