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"
      } 
     ]
    }
    

  • 相关阅读:
    Centos 配置网易YUM源
    JDK 变量配置
    redis如何解决key冲突?
    大数据技术(1)流式计算与Storm
    20151211小问题
    返回顶部
    20151210小问题2
    20151210小问题
    20151209小问题
    前端程序员的自我修养
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199245.html
Copyright © 2011-2022 走看看