mget 获取多个文档
1、curl 命令格式:mget获取多个文档:
curl 'localhost:9200/_mget' -d '{
"docs":[
{
"_index":"shakespeare",
"_type":"line",
"_id":"6",
"_source":"play_name"
},
{
"_index":"shakespeare",
"_type":"line",
"_id":"28",
"_source":"play_name"
}
]
}
2、sense命令:mget 获取多个文档
请求命令:
GET /_mget
{
"docs":[
{
"_index":"shakespeare",
"_type":"line",
"_id":"6",
"_source":["play_name","speaker","text_entry"]
},
{
"_index":"shakespeare",
"_type":"line",
"_id":"28",
"_source":"play_name"
}
]
}
3、获取相同index、相同type下,不同 _id 的文档
GET /shakespeare/line/_mget
{
"ids":[ "6","20" ]
}