版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42528266/article/details/102798546
简介:⼿把⼿演示⽂档的增删改查
{
"name":"哈登",
"team_name":"⽕箭",
"position":"得分后卫",
"play_year":"10",
"jerse_no":"13"
}
{
"_index": "nba",
"_type": "_doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1
}
{
"name":"库⾥",
"team_name":"勇⼠",
"position":"组织后卫",
"play_year":"10",
"jerse_no":"30"
}
{
"_index": "nba",
"_type": "_doc",
"_id": "cVi582sB6wrnBnZnFqog",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 1,
"_primary_term": 1
}
{
"persistent": {
"action.auto_create_index": "false"
}
}
{
"acknowledged": true,
"persistent": {
"action": {
"auto_create_index": "false"
}
},
"transient": {}
}
{
"name":"杨超越",
"team_name":"梦之队",
"position":"组织后卫",
"play_year":"0",
"jerse_no":"18"
}
{
"error": {
"root_cause": [{
"type": "index_not_found_exception",
"reason": "no such index [wnba]",
"resource.type": "index_expression",
"resource.id": "wnba",
"index_uuid": "_na_",
"index": "wnba"
}],
"type": "index_not_found_exception",
"reason": "no such index [wnba]",
"resource.type": "index_expression",
"resource.id": "wnba",
"index_uuid": "_na_",
"index": "wnba"
},
"status": 404
}
{
"name":"杨超越",
"team_name":"梦之队",
"position":"组织后卫",
"play_year":"0",
"jerse_no":"18"
}
{
"_index": "wnba",
"_type": "_doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1
}
{
"name":"哈登",
"team_name":"⽕箭",
"position":"得分后卫",
"play_year":"10",
"jerse_no":"13"
}
{
"error": {
"root_cause": [{
"type": "version_conflict_engine_exception",
"reason": "[1]: version conflict, document already
exists(current version[2])
",
"index_uuid": "oPdc9qAjRO-IlzPfymnpkg",
"shard": "0",
"index": "nba"
}],
"type": "version_conflict_engine_exception",
"reason": "[1]: version conflict, document already exists
(current version[2])
",
"index_uuid": "oPdc9qAjRO-IlzPfymnpkg",
"shard": "0",
"index": "nba"
},
"status": 409
}
{
"_index": "nba",
"_type": "_doc",
"_id": "1",
"_version": 3,
"_seq_no": 3,
"_primary_term": 1,
"found": true,
"_source": {
"name": "哈登",
"team_name": "⽕箭",
"position": "得分后卫",
"play_year": "10",
"jerse_no": "13"
}
}
{
"docs": [{
"_index": "nba",
"_type": "_doc",
"_id": "1"
},
{
"_index": "nba",
"_type": "_doc",
"_id": "2"
}
]
} {
"docs": [{
"_index": "nba",
"_type": "_doc",
"_id": "1",
"_version": 3,
"_seq_no": 3,
"_primary_term": 1,
"found": true,
"_source": {
"name": "哈登",
"team_name": "⽕箭",
"position": "得分后卫",
"play_year": "10",
"jerse_no": "13"
}
},
{
"_index": "nba",
"_type": "_doc",
"_id": "2",
"found": false
}
]
}
{
"docs": [{
"_type": "_doc",
"_id": "1"
},
{
"_type": "_doc",
"_id": "2"
}
]
}
{
"docs": [{
"_id": "1"
},
{
"_id": "2"
}
]
}
{
"ids" : ["1", "2"]
}
{
"doc": {
"name": "哈登",
"team_name": "⽕箭",
"position": "双能卫",
"play_year": "10",
"jerse_no": "13"
}
}
{
"script": "ctx._source.age = 18"
}
{
"script": "ctx._source.remove(\"age\")"
}
{
"script": {
"source": "ctx._source.age += params.age",
"params": {
"age": 4
}
}
}
{
"script": {
"source": "ctx._source.allstar += params.allstar",
"params": {
"allstar": 4
}
},
"upsert": {
"allstar": 1
}
}