首页 > IT基础架构 > > ES-mget批量查询
GET /_mget
{
"docs": [
{
"_index": "testa_index",
"_type": "testa_type",
"_id": 1
},
{
"_index": "testb_index",
"_type": "testb_type",
"_id": 2
}
]
}
GET test_index/_mget
{
"docs": [
{
"_type": "testa_type",
"_id": 1
},
{
"_type": "testb_type",
"_id": 2
}
]
}
GET test_index/test_type/_mget
{
"ids": [1,2]
}
mget是很重要的,一般来说,进行查询的时候,如果一次性查询多条数据的话,那么一定要用batch批量操作的api,尽可能减少网络开销次数,可能可以将性能提升数倍,甚至十倍,非常非常重要。




来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69946831/viewspace-3122238/ ,如需转载,请注明出处,否则将追究法律责任。