• 06_Elasticsearch 批量获取mget


    06_Elasticsearch 批量获取mget
    
    现在有:
    
    http://192.168.32.81:9200/bank/bank_account/1
    
    http://192.168.32.81:9200/bank/bank_account/2
    
    http://192.168.32.81:9200/bank/bank_account/3
    
    http://192.168.32.81:9200/bank/bank_account/4
    
    http://192.168.32.81:9200/_mget/
                                 POST
    {
      "docs":[
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":1
    },
    
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":2
    },
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":3
      } 
     ]
    }
    
    
    返回:
    {
    
        "docs": [
            {
                "_index": "bank",
                "_type": "bank_account",
                "_id": "1",
                "_version": 1,
                "found": true,
                "_source": {
                    "title": "Elasticsearch:The scan",
                    "name": {
                        "first": "aaa",
                        "last": "bbb"
                    },
                    "publish_date": "2016-09-06",
                    "price": "49"
                }
            }
            ,
            {
                "_index": "bank",
                "_type": "bank_account",
                "_id": "2",
                "_version": 1,
                "found": true,
                "_source": {
                    "title": "Elasticsearch:The scan",
                    "name": {
                        "first": "aaa",
                        "last": "bbb"
                    },
                    "publish_date": "2016-09-06",
                    "price": "59"
                }
            }
            ,
            {
                "_index": "bank",
                "_type": "bank_account",
                "_id": "3",
                "_version": 1,
                "found": true,
                "_source": {
                    "title": "Elasticsearch:The scan",
                    "name": {
                        "first": "aaa",
                        "last": "bbb"
                    },
                    "publish_date": "2016-09-06",
                    "price": "69"
                }
            }
        ]
    
    }
    
    
    获取某个字段:
    {
      "docs":[
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":1,
          "_source":"price"
    },
    
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":2,
           "_source":"price"
    },
         {
          "_index":"bank",
          "_type":"bank_account",
          "_id":3,
    "_source":"price"
      } ,
       {
          "_index":"bank",
          "_type":"bank_account",
          "_id":4,
    "_source":"price"
      } 
     ]
    }
    

  • 相关阅读:
    《全职高手》的全部职业和职业技能(最新版)
    博客园样式美化
    科幻电影免费百度云分享(Scince-fiction cloud share)
    阅读须知
    Website's Game source code
    #P2010 回文日期 的题解
    #P1909 买铅笔 的题解
    #P4770 [NOI2018]你的名字 的题解
    #1074 骑士问题 的题解
    [C++基本语法:从菜鸟变成大佬系列,就像1,2,3那么简单](七):C++的修饰符
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350300.html
Copyright © 2020-2023  润新知