func (s *SearchShardsService) Validate() error {
	var invalid []string
	if len(s.index) < 1 {
		invalid = append(invalid, "Index")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
Validate checks if the operation is valid.
package elastic
import (
	"context"
	"fmt"
	"net/url"
	"strings"
	"time"
	"github.com/olivere/elastic/uritemplates"
)
type SearchShardsService struct {
	client            *Client
	pretty            bool
	index             []string
	routing           string
	local             *bool
	preference        string
	ignoreUnavailable *bool
	allowNoIndices    *bool
	expandWildcards   string
}
func NewSearchShardsService(client *Client) *SearchShardsService {
	return &SearchShardsService{
		client: client,
	}
}
func (s *SearchShardsService) Index(index ...string) *SearchShardsService {
	s.index = append(s.index, index...)
	return s
}
func (s *SearchShardsService) Local(local bool) *SearchShardsService {
	s.local = &local
	return s
}
func (s *SearchShardsService) Routing(routing string) *SearchShardsService {
	s.routing = routing
	return s
}
func (s *SearchShardsService) Preference(preference string) *SearchShardsService {
	s.preference = preference
	return s
}
func (s *SearchShardsService) Pretty(pretty bool) *SearchShardsService {
	s.pretty = pretty
	return s
}
func (s *SearchShardsService) IgnoreUnavailable(ignoreUnavailable bool) *SearchShardsService {
	s.ignoreUnavailable = &ignoreUnavailable
	return s
}
func (s *SearchShardsService) AllowNoIndices(allowNoIndices bool) *SearchShardsService {
	s.allowNoIndices = &allowNoIndices
	return s
}
func (s *SearchShardsService) ExpandWildcards(expandWildcards string) *SearchShardsService {
	s.expandWildcards = expandWildcards
	return s
}
func (s *SearchShardsService) buildURL() (string, url.Values, error) {
	path, err := uritemplates.Expand("/{index}/_search_shards", map[string]string{
		"index": strings.Join(s.index, ","),
	})
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", "true")
	}
	if s.preference != "" {
		params.Set("preference", s.preference)
	}
	if s.local != nil {
		params.Set("local", fmt.Sprintf("%v", *s.local))
	}
	if s.routing != "" {
		params.Set("routing", s.routing)
	}
	if s.allowNoIndices != nil {
		params.Set("allow_no_indices", fmt.Sprintf("%v", *s.allowNoIndices))
	}
	if s.expandWildcards != "" {
		params.Set("expand_wildcards", s.expandWildcards)
	}
	if s.ignoreUnavailable != nil {
		params.Set("ignore_unavailable", fmt.Sprintf("%v", *s.ignoreUnavailable))
	}
	return path, params, nil
}