Skip to content

Commit 9005e28

Browse files
committed
Removed unsupported fields from Sampler aggregation
Both `max_docs_per_value` as well as `execution_hint` no longer exist in v7. Close #1251
1 parent 9f6409a commit 9005e28

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

search_aggs_bucket_sampler.go

+1-20
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ type SamplerAggregation struct {
1414
subAggregations map[string]Aggregation
1515
meta map[string]interface{}
1616

17-
shardSize int
18-
maxDocsPerValue int
19-
executionHint string
17+
shardSize int
2018
}
2119

2220
func NewSamplerAggregation() *SamplerAggregation {
2321
return &SamplerAggregation{
2422
shardSize: -1,
25-
maxDocsPerValue: -1,
2623
subAggregations: make(map[string]Aggregation),
2724
}
2825
}
@@ -44,16 +41,6 @@ func (a *SamplerAggregation) ShardSize(shardSize int) *SamplerAggregation {
4441
return a
4542
}
4643

47-
func (a *SamplerAggregation) MaxDocsPerValue(maxDocsPerValue int) *SamplerAggregation {
48-
a.maxDocsPerValue = maxDocsPerValue
49-
return a
50-
}
51-
52-
func (a *SamplerAggregation) ExecutionHint(hint string) *SamplerAggregation {
53-
a.executionHint = hint
54-
return a
55-
}
56-
5744
func (a *SamplerAggregation) Source() (interface{}, error) {
5845
// Example:
5946
// {
@@ -82,12 +69,6 @@ func (a *SamplerAggregation) Source() (interface{}, error) {
8269
if a.shardSize >= 0 {
8370
opts["shard_size"] = a.shardSize
8471
}
85-
if a.maxDocsPerValue >= 0 {
86-
opts["max_docs_per_value"] = a.maxDocsPerValue
87-
}
88-
if a.executionHint != "" {
89-
opts["execution_hint"] = a.executionHint
90-
}
9172

9273
// AggregationBuilder (SubAggregations)
9374
if len(a.subAggregations) > 0 {

0 commit comments

Comments
 (0)