Update time_series_query.go

fix alert no data when elasticsearch group by terms size is set to no limit
(cherry picked from commit 3b9ab6e204)
This commit is contained in:
Yuan Liu
2018-10-16 01:19:41 +02:00
committed by Marcus Efraimsson
parent 8696b27c09
commit ac6bd22fd4
@@ -171,6 +171,10 @@ func addTermsAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg, metrics []*Metr
} else {
a.Size = 500
}
if a.Size == 0 {
a.Size = 500
}
if minDocCount, err := bucketAgg.Settings.Get("min_doc_count").Int(); err == nil {
a.MinDocCount = &minDocCount
}