title: Group by multiple columns in elastic search with specific result set
body: <p>I am new to ES and i have some specific requirement, my document look like this</p>
  
  <pre><code>{
      "_index" : "bidder_server_stats",
      "_type" : "doc",
      "_id" : "_NTrHGQBv0YTjfMi0Ord",
      "_score" : 1.0,
      "_source" : {
        "avg_price" : 5.8,
        "bc" : "2513",
        "log_dt_st" : "2018-06-08T06:36:16.073Z",
        "nid" : "1",
        "cc" : "880",
        "host" : "ip-172-31-18-62.ec2.internal",
        "country" : "us"
      }
    },
    {
      "_index" : "bidder_server_stats",
      "_type" : "doc",
      "_id" : "_NTrHGQBv0YTjfMi0Ord",
      "_score" : 1.0,
      "_source" : {
        "avg_price" : 10,
        "bc" : "2514",
        "log_dt_st" : "2018-06-08T06:36:16.073Z",
        "nid" : "1",
        "cc" : "880",
        "host" : "ip-172-31-18-62.ec2.internal",
        "country" : "us"
      }
    },
    {
      "_index" : "bidder_server_stats",
      "_type" : "doc",
      "_id" : "_NTrHGQBv0YTjfMi0Ord",
      "_score" : 1.0,
      "_source" : {
        "avg_price" : 11,
        "bc" : "2513",
        "log_dt_st" : "2018-06-08T06:36:16.073Z",
        "nid" : "1",
        "cc" : "880",
        "host" : "ip-172-31-18-62.ec2.internal",
        "country" : "us"
      }
    }
  </code></pre>
  
  <p>Now i need the result as i get using below query</p>
  
  <pre><code>select bc,log_dt_st,sum(avg_price) from table group by bc,log_dt_st.
  </code></pre>
  
  <p>How can we do this in elasticsearch. And i want only these three columns in result set (i.e. _source).</p>
  
  <p>Please help</p>