zoukankan      html  css  js  c++  java
  • 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"
      } 
     ]
    }
    

  • 相关阅读:
    Spring Boot 中加载XML配置
    C#winfrom打开指定的文件
    C#怎么实现文件下载功能的四种方法
    C#查看已下载文件大小和扩展名
    C#winfrom文件下载到本地
    判断DataGridView是否选中某行
    Secure CRT注册码
    http-server 开启服
    学习网址
    angular中table表格组件的使用
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350300.html
Copyright © 2011-2022 走看看