文章40 | 阅读 24040 | 点赞0
Multi GET API介绍
GET /lib/user/_mget
{
"docs":[
{
"_id":1
},
{
"_type":"user",
"_id":2
}
]
}
#返回值
{
"docs" : [
{
"_index" : "lib",
"_type" : "user",
"_id" : "1",
"_version" : 1,
"_seq_no" : 7,
"_primary_term" : 1,
"found" : true,
"_source" : {
"first_name" : "Jane",
"last_name" : "Smith",
"age" : 36,
"about" : "I like to collect rock albums",
"interests" : [
"music"
]
}
},
{
"_index" : "lib",
"_type" : "user",
"_id" : "2",
"_version" : 1,
"_seq_no" : 3,
"_primary_term" : 1,
"found" : true,
"_source" : {
"first_name" : "Jane",
"last_name" : "tom",
"age" : 38,
"about" : "I like to collect rock albums",
"interests" : [
"music"
]
}
}
]
}
更简单的:
GET /lib/user/_mget
{
"ids":["1","2","3"]
}
返回结果:
{
"docs" : [
{
"_index" : "lib",
"_type" : "user",
"_id" : "1",
"_version" : 1,
"_seq_no" : 7,
"_primary_term" : 1,
"found" : true,
"_source" : {
"first_name" : "Jane",
"last_name" : "Smith",
"age" : 36,
"about" : "I like to collect rock albums",
"interests" : [
"music"
]
}
},
{
"_index" : "lib",
"_type" : "user",
"_id" : "2",
"_version" : 1,
"_seq_no" : 3,
"_primary_term" : 1,
"found" : true,
"_source" : {
"first_name" : "Jane",
"last_name" : "tom",
"age" : 38,
"about" : "I like to collect rock albums",
"interests" : [
"music"
]
}
},
{
"_index" : "lib",
"_type" : "user",
"_id" : "3",
"found" : false
}
]
}
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/ywl470812087/article/details/104828434
内容来源于网络,如有侵权,请联系作者删除!