标签:create first xxx 查找 筛选 索引 根据 delete name
批量操作
POST _bulk
{ "index" : { "_index" : "movies", "_id" : "1" } }
{ "year" : 1994 }
{ "delete" : { "_index" : "movies", "_id" : "1" } }
{ "delete" : { "_index" : "movies1", "_id" : "1" } }
{ "create" : { "_index" : "movies", "_id" : "1" } }
{ "year" : "1994" }
{ "update" : {"_id" : "1", "_index" : "movies"} }
{ "doc" : {"name" : "1"} }
批量操作 指定索引
POST movies/_bulk
{ "index" : { "_id" : "2" } }
{ "year" : 1994 }
{ "delete" : { "_id" : "2" } }
{ "create" : { "_id" : "2" } }
{ "year" : "19924" }
{ "update" : {"_id" : "2"} }
{ "doc" : {"name" : "XXXX2"} }
简单的根据id 查找
GET _mget
{
"docs":[
{
"_index":"movies",
"_id":1
}, {
"_index":".kibana-event-log-7.10.2-000001",
"_id":1
}
]
}
结果:
{
"docs" : [
{
"_index" : "movies",
"_type" : "_doc",
"_id" : "1",
"_version" : 16,
"_seq_no" : 9779,
"_primary_term" : 10,
"found" : true,
"_source" : {
"year" : "1994",
"name" : "1"
}
},
{
"_index" : ".kibana-event-log-7.10.2-000001",
"_type" : "_doc",
"_id" : "1",
"found" : false
}
]
}
筛选源
GET _mget
{
"docs":[
{
"_index":"movies",
"_id":1,
"_source":["year"]
},
{
"_index":"movies",
"_id":15061,
"_source": {
"include": [ "year","user" ],
"exclude": [ "user.full_name" ]
}
}
]
}
结果
{
"docs" : [
{
"_index" : "movies",
"_type" : "_doc",
"_id" : "1",
"_version" : 16,
"_seq_no" : 9779,
"_primary_term" : 10,
"found" : true,
"_source" : {
"year" : "1994"
}
},
{
"_index" : "movies",
"_type" : "_doc",
"_id" : "15061",
"_version" : 1,
"_seq_no" : 9784,
"_primary_term" : 10,
"found" : true,
"_source" : {
"year" : 1994,
"user" : {
"last_name" : "jiayue",
"first_name" : "bi"
}
}
}
]
}
标签:create first xxx 查找 筛选 索引 根据 delete name
原文地址:https://www.cnblogs.com/roinbi/p/14515674.html