Skip to content

Commit

Permalink
add secondary size limit for NewTermsAggregation to support limit
Browse files Browse the repository at this point in the history
querystring.
  • Loading branch information
notque committed Dec 11, 2017
1 parent 1f3f083 commit 1cd3ca5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (es ElasticSearch) GetAttributes(filter *AttributeFilter, tenantID string)
}
util.LogDebug("Mapped Queryname: %s --> %s", filter.QueryName, esName)

queryAgg := elastic.NewTermsAggregation().Field(esName)
queryAgg := elastic.NewTermsAggregation().Size(int(filter.Limit)).Field(esName)

esSearch := es.client().Search().Index(index).Size(int(filter.Limit)).Aggregation("attributes", queryAgg)
searchResult, err := esSearch.Do(context.Background())
Expand Down

0 comments on commit 1cd3ca5

Please sign in to comment.