1、批量查询优势
如果一条一条查询,查询100条就需要100次
如果批量查询,就只需要查询1次,网络请求性能开销缩减100倍
2、mget演练
#取两条数据GET /_mget{"docs":[{"_index":"bobotest","_id":"1"},{"_index":"bobotest","_id":"2"}]}{"docs" : [{"_index" : "bobotest","_type" : "_doc","_id" : "1","_version" : 2,"_seq_no" : 9,"_primary_term" : 1,"found" : true,"_source" : {"name" : "tian bo","desc" : "ke ai","age" : 11,"tags" : ["keai","kuaile"]}},{"_index" : "bobotest","_type" : "_doc","_id" : "2","_version" : 2,"_seq_no" : 10,"_primary_term" : 1,"found" : true,"_source" : {"name" : "liang","desc" : "liangzai","age" : 16,"tags" : ["shuai","liang"]}}]}#取同一index下的2条数据GET /bobotest/_mget{"docs":[{"_id":"1"},{"_id":"2"}]}
3、mget的重要性
如果在一次查询多条数据时,一定要用batch批量操作的api,能使性能提升好几倍
