獲取單個id文檔:
get blog/type_blog/1
響應信息:
{
"_index":"blog",
"_type":"type_blog",
"_id":"1",
"found":true,
"_source":{
"id":1,
"name":"zhangsan",
......
}
}
found:表示是否查詢到數據
source:返回的數據
獲取多個文檔:
get _mget
{
"docs":[{
"_index":"blog",
"_type":"type_blog",
"_id":"1"
},{
"_index":"blog1",
"_type":"type_blog1",
"_id":"1"
}]
}
相同索引:
get blog/_mget
{
"docs":[{
"_type":"type_blog",
"_id":"1"
},{
"_type":"type_blog1",
"_id":"1"
}]
}
相同索引,類型
get blog/type_blog/_mget
{
"docs":[{
"_id":"1"
},{
"_id":"2"
}]
}
簡寫:
get blog/type_blog/_mget
{
"ids":["1","2"]
}