Skip to content

Commit

Permalink
CBB-1170: remove param for source disable
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmitharoo committed Aug 27, 2024
1 parent 4c55d76 commit 2a0e432
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions aggs_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ func (agg *TopHitsAgg) Sorts(sorts ...map[string]Sort) *TopHitsAgg {
}

// SourceDisabled when set will prevent source fields returning
func (agg *TopHitsAgg) SourceDisabled(b bool) *TopHitsAgg {
agg.source.disabled = b
func (agg *TopHitsAgg) SourceDisabled() *TopHitsAgg {
agg.source.disabled = true
return agg
}

Expand Down
2 changes: 1 addition & 1 deletion aggs_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func TestMetricAggs(t *testing.T) {
},
}...,
).
SourceDisabled(true),
SourceDisabled(),
map[string]interface{}{
"top_hits": map[string]interface{}{
"sort": []map[string]interface{}{
Expand Down
4 changes: 2 additions & 2 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func (req *SearchRequest) Timeout(dur time.Duration) *SearchRequest {
}

// SourceDisabled when set will prevent source fields returning
func (req *SearchRequest) SourceDisabled(b bool) *SearchRequest {
req.source.disabled = b
func (req *SearchRequest) SourceDisabled() *SearchRequest {
req.source.disabled = true
return req
}

Expand Down
2 changes: 1 addition & 1 deletion search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestSearchMaps(t *testing.T) {
},
{
"a simple query with no source",
Search().SearchAfter("_id", "name").SourceDisabled(true),
Search().SearchAfter("_id", "name").SourceDisabled(),
map[string]interface{}{
"search_after": []string{"_id", "name"},
"_source": false,
Expand Down

0 comments on commit 2a0e432

Please sign in to comment.