diff --git a/client.go b/client.go index 5fef9344f..4326a8f3a 100644 --- a/client.go +++ b/client.go @@ -26,7 +26,7 @@ import ( const ( // Version is the current version of Elastic. - Version = "5.0.50" + Version = "5.0.51" // DefaultURL is the default endpoint of Elasticsearch on the local machine. // It is used e.g. when initializing a new Client without a specific URL. diff --git a/msearch.go b/msearch.go index 52ca9ee74..5d0949d9c 100644 --- a/msearch.go +++ b/msearch.go @@ -68,7 +68,7 @@ func (s *MultiSearchService) Do(ctx context.Context) (*MultiSearchResult, error) if err != nil { return nil, err } - body, err := json.Marshal(sr.body()) + body, err := json.Marshal(sr.Body()) if err != nil { return nil, err } diff --git a/search_request.go b/search_request.go index ad22a5a3f..03513085f 100644 --- a/search_request.go +++ b/search_request.go @@ -194,9 +194,12 @@ func (r *SearchRequest) header() interface{} { return h } -// body is used by MultiSearch to get information about the search body +// Body allows to access the search body of the request, as generated by the DSL. +// Notice that Body is read-only. You must not change the request body. +// +// Body is used e.g. by MultiSearch to get information about the search body // of one SearchRequest. -// See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html -func (r *SearchRequest) body() interface{} { +// See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-multi-search.html +func (r *SearchRequest) Body() interface{} { return r.source }