diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-09-28 12:40:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 12:40:17 -0700 |
commit | a8c01377bce777bf1940850e390e587c290e98e0 (patch) | |
tree | 0e176269b5faae110bb402b209d4f192654a435c /vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go | |
parent | 006623e0f737ca7ee5d482fe47c09048a6f3d06a (diff) | |
download | chat-a8c01377bce777bf1940850e390e587c290e98e0.tar.gz chat-a8c01377bce777bf1940850e390e587c290e98e0.tar.bz2 chat-a8c01377bce777bf1940850e390e587c290e98e0.zip |
Updating server dependancies. (#9498)
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go b/vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go index 17916b490..aaebe0a92 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go @@ -23,6 +23,7 @@ type DateHistogramAggregation struct { timeZone string format string offset string + keyed *bool } // NewDateHistogramAggregation creates a new DateHistogramAggregation. @@ -196,6 +197,13 @@ func (a *DateHistogramAggregation) ExtendedBoundsMax(max interface{}) *DateHisto return a } +// Keyed specifies whether to return the results with a keyed response (or not). +// See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-aggregations-bucket-datehistogram-aggregation.html#_keyed_response_3. +func (a *DateHistogramAggregation) Keyed(keyed bool) *DateHistogramAggregation { + a.keyed = &keyed + return a +} + func (a *DateHistogramAggregation) Source() (interface{}, error) { // Example: // { @@ -262,6 +270,9 @@ func (a *DateHistogramAggregation) Source() (interface{}, error) { } opts["extended_bounds"] = bounds } + if a.keyed != nil { + opts["keyed"] = *a.keyed + } // AggregationBuilder (SubAggregations) if len(a.subAggregations) > 0 { |