func (f Mtermvectors) WithIndex(v string) func(*MtermvectorsRequest) {
	return func(r *MtermvectorsRequest) {
		r.Index = v
	}
}
WithIndex - the index in which the document resides..
package opensearchapi
import (
	"context"
	"io"
	"net/http"
	"strconv"
	"strings"
)
func newMtermvectorsFunc(t Transport) Mtermvectors {
	return func(o ...func(*MtermvectorsRequest)) (*Response, error) {
		var r = MtermvectorsRequest{}
		for _, f := range o {
			f(&r)
		}
		return r.Do(r.ctx, t)
	}
}
type Mtermvectors func(o ...func(*MtermvectorsRequest)) (*Response, error)
type MtermvectorsRequest struct {
	Index        string
	DocumentType string
	Body io.Reader
	Fields          []string
	FieldStatistics *bool
	Ids             []string
	Offsets         *bool
	Payloads        *bool
	Positions       *bool
	Preference      string
	Realtime        *bool
	Routing         string
	TermStatistics  *bool
	Version         *int
	VersionType     string
	Pretty     bool
	Human      bool
	ErrorTrace bool
	FilterPath []string
	Header http.Header
	ctx context.Context
}
func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
	var (
		method string
		path   strings.Builder
		params map[string]string
	)
	method = "POST"
	path.Grow(1 + len(r.Index) + 1 + len(r.DocumentType) + 1 + len("_mtermvectors"))
	if r.Index != "" {
		path.WriteString("/")
		path.WriteString(r.Index)
	}
	if r.DocumentType != "" {
		path.WriteString("/")
		path.WriteString(r.DocumentType)
	}
	path.WriteString("/")
	path.WriteString("_mtermvectors")
	params = make(map[string]string)
	if len(r.Fields) > 0 {
		params["fields"] = strings.Join(r.Fields, ",")
	}
	if r.FieldStatistics != nil {
		params["field_statistics"] = strconv.FormatBool(*r.FieldStatistics)
	}
	if len(r.Ids) > 0 {
		params["ids"] = strings.Join(r.Ids, ",")
	}
	if r.Offsets != nil {
		params["offsets"] = strconv.FormatBool(*r.Offsets)
	}
	if r.Payloads != nil {
		params["payloads"] = strconv.FormatBool(*r.Payloads)
	}
	if r.Positions != nil {
		params["positions"] = strconv.FormatBool(*r.Positions)
	}
	if r.Preference != "" {
		params["preference"] = r.Preference
	}
	if r.Realtime != nil {
		params["realtime"] = strconv.FormatBool(*r.Realtime)
	}
	if r.Routing != "" {
		params["routing"] = r.Routing
	}
	if r.TermStatistics != nil {
		params["term_statistics"] = strconv.FormatBool(*r.TermStatistics)
	}
	if r.Version != nil {
		params["version"] = strconv.FormatInt(int64(*r.Version), 10)
	}
	if r.VersionType != "" {
		params["version_type"] = r.VersionType
	}
	if r.Pretty {
		params["pretty"] = "true"
	}
	if r.Human {
		params["human"] = "true"
	}
	if r.ErrorTrace {
		params["error_trace"] = "true"
	}
	if len(r.FilterPath) > 0 {
		params["filter_path"] = strings.Join(r.FilterPath, ",")
	}
	req, err := newRequest(method, path.String(), r.Body)
	if err != nil {
		return nil, err
	}
	if len(params) > 0 {
		q := req.URL.Query()
		for k, v := range params {
			q.Set(k, v)
		}
		req.URL.RawQuery = q.Encode()
	}
	if r.Body != nil {
		req.Header[headerContentType] = headerContentTypeJSON
	}
	if len(r.Header) > 0 {
		if len(req.Header) == 0 {
			req.Header = r.Header
		} else {
			for k, vv := range r.Header {
				for _, v := range vv {
					req.Header.Add(k, v)
				}
			}
		}
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := transport.Perform(req)
	if err != nil {
		return nil, err
	}
	response := Response{
		StatusCode: res.StatusCode,
		Body:       res.Body,
		Header:     res.Header,
	}
	return &response, nil
}
func (f Mtermvectors) WithContext(v context.Context) func(*MtermvectorsRequest) {
	return func(r *MtermvectorsRequest) {
		r.ctx = v
	}
}
func (f Mtermvectors) WithBody(v io.Reader) func(*MtermvectorsRequest) {
	return func(r *MtermvectorsRequest) {
		r.Body = v
	}
}