Skip to content

Commit

Permalink
Adds source filtering for SearchDsl
Browse files Browse the repository at this point in the history
This is different from the Fields methods as ElasticSearch will return a _source with only the fields specified.
  • Loading branch information
cerisier committed Mar 7, 2016
1 parent 6846107 commit ef69a23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/searchsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func (s *SearchDsl) Source(returnSource bool) *SearchDsl {
return s
}

func (s *SearchDsl) SourceFields(fields ...string) *SearchDsl {
s.args["_source"] = fields
return s
}
// Facet passes a Query expression to this search
//
// qry := Search("github").Size("0").Facet(
Expand Down

0 comments on commit ef69a23

Please sign in to comment.