summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/search_aggs_bucket_date_histogram.go
diff options
context:
space:
mode:
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.go11
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 {