func (s *IndicesAnalyzeService) Do(ctx context.Context) (*IndicesAnalyzeResponse, error) {
	if err := s.Validate(); err != nil {
		return nil, err
	}
	path, params, err := s.buildURL()
	if err != nil {
		return nil, err
	}
	var body interface{}
	if s.bodyJson != nil {
		body = s.bodyJson
	} else if s.bodyString != "" {
		body = s.bodyString
	} else {
		body = s.request
	}
	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
		Method:  "POST",
		Path:    path,
		Params:  params,
		Body:    body,
		Headers: s.headers,
	})
	if err != nil {
		return nil, err
	}
	ret := new(IndicesAnalyzeResponse)
	if err = s.client.decoder.Decode(res.Body, ret); err != nil {
		return nil, err
	}
	return ret, nil
}
Do will execute the request with the given context.
package elastic
import (
	"context"
	"fmt"
	"net/http"
	"net/url"
	"strings"
	"github.com/olivere/elastic/v7/uritemplates"
)
type IndicesAnalyzeService struct {
	client *Client
	pretty     *bool        
	human      *bool        
	errorTrace *bool        
	filterPath []string     
	headers    http.Header  
	index       string
	request     *IndicesAnalyzeRequest
	format      string
	preferLocal *bool
	bodyJson    interface{}
	bodyString  string
}
func NewIndicesAnalyzeService(client *Client) *IndicesAnalyzeService {
	return &IndicesAnalyzeService{
		client:  client,
		request: new(IndicesAnalyzeRequest),
	}
}
func (s *IndicesAnalyzeService) Pretty(pretty bool) *IndicesAnalyzeService {
	s.pretty = &pretty
	return s
}
func (s *IndicesAnalyzeService) Human(human bool) *IndicesAnalyzeService {
	s.human = &human
	return s
}
func (s *IndicesAnalyzeService) ErrorTrace(errorTrace bool) *IndicesAnalyzeService {
	s.errorTrace = &errorTrace
	return s
}
func (s *IndicesAnalyzeService) FilterPath(filterPath ...string) *IndicesAnalyzeService {
	s.filterPath = filterPath
	return s
}
func (s *IndicesAnalyzeService) Header(name string, value string) *IndicesAnalyzeService {
	if s.headers == nil {
		s.headers = http.Header{}
	}
	s.headers.Add(name, value)
	return s
}
func (s *IndicesAnalyzeService) Headers(headers http.Header) *IndicesAnalyzeService {
	s.headers = headers
	return s
}
func (s *IndicesAnalyzeService) Index(index string) *IndicesAnalyzeService {
	s.index = index
	return s
}
func (s *IndicesAnalyzeService) Format(format string) *IndicesAnalyzeService {
	s.format = format
	return s
}
func (s *IndicesAnalyzeService) PreferLocal(preferLocal bool) *IndicesAnalyzeService {
	s.preferLocal = &preferLocal
	return s
}
func (s *IndicesAnalyzeService) Request(request *IndicesAnalyzeRequest) *IndicesAnalyzeService {
	if request == nil {
		s.request = new(IndicesAnalyzeRequest)
	} else {
		s.request = request
	}
	return s
}
func (s *IndicesAnalyzeService) Analyzer(analyzer string) *IndicesAnalyzeService {
	s.request.Analyzer = analyzer
	return s
}
func (s *IndicesAnalyzeService) Attributes(attributes ...string) *IndicesAnalyzeService {
	s.request.Attributes = attributes
	return s
}
func (s *IndicesAnalyzeService) CharFilter(charFilter ...string) *IndicesAnalyzeService {
	s.request.CharFilter = charFilter
	return s
}
func (s *IndicesAnalyzeService) Explain(explain bool) *IndicesAnalyzeService {
	s.request.Explain = explain
	return s
}
func (s *IndicesAnalyzeService) Field(field string) *IndicesAnalyzeService {
	s.request.Field = field
	return s
}
func (s *IndicesAnalyzeService) Filter(filter ...string) *IndicesAnalyzeService {
	s.request.Filter = filter
	return s
}
func (s *IndicesAnalyzeService) Text(text ...string) *IndicesAnalyzeService {
	s.request.Text = text
	return s
}
func (s *IndicesAnalyzeService) Tokenizer(tokenizer string) *IndicesAnalyzeService {
	s.request.Tokenizer = tokenizer
	return s
}
func (s *IndicesAnalyzeService) BodyJson(body interface{}) *IndicesAnalyzeService {
	s.bodyJson = body
	return s
}
func (s *IndicesAnalyzeService) BodyString(body string) *IndicesAnalyzeService {
	s.bodyString = body
	return s
}
func (s *IndicesAnalyzeService) buildURL() (string, url.Values, error) {
	var err error
	var path string
	if s.index == "" {
		path = "/_analyze"
	} else {
		path, err = uritemplates.Expand("/{index}/_analyze", map[string]string{
			"index": s.index,
		})
	}
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if v := s.pretty; v != nil {
		params.Set("pretty", fmt.Sprint(*v))
	}
	if v := s.human; v != nil {
		params.Set("human", fmt.Sprint(*v))
	}
	if v := s.errorTrace; v != nil {
		params.Set("error_trace", fmt.Sprint(*v))
	}
	if len(s.filterPath) > 0 {
		params.Set("filter_path", strings.Join(s.filterPath, ","))
	}
	if s.format != "" {
		params.Set("format", s.format)
	}
	if s.preferLocal != nil {
		params.Set("prefer_local", fmt.Sprintf("%v", *s.preferLocal))
	}
	return path, params, nil
}