title: How to get distinct values with olivere/elastic in Go
body: <pre><code>{
     "query" : {
          "match_all":{}
      },
      "aggs":{
          "geo": {
              "terms": {
                  "field": "geoCurrent.keyword"
              }
          }
      }
  }
  </code></pre>
  
  <p>Hello. Request above sent from postman works ok. I need to do this query from golang to get distinct field values.
  I found examples like:</p>
  
  <pre><code>// ec - elastic client
  s := ec.Search().Index(dbName).Query(elastic.NewMatchAllQuery()).Type("_doc")
  agg := elastic.NewTermsAggregation().Field("geoCurrent.keyword")
  s = s.Aggregation("geo", agg)
  s.Size(0)
  r, err := s.Do(context.Background())
  if nil != err {
      log.Println(err)
      return
  }
  
  resp, ok := r.Aggregations.Terms("geo")
  if !ok {
      log.Println(ok)
      return
  }
  
  for _, res := range resp.Buckets {
      log.Println(res.Key)
  }
  </code></pre>
  
  <p>But resp.Bucket is empty. Whats wrong?</p>