// FielddataFields is a list of fields for `fielddata` index metric (supports wildcards).
174994
func (s *IndicesStatsService) FielddataFields(fielddataFields ...string) *IndicesStatsService {
	s.fielddataFields = append(s.fielddataFields, fielddataFields...)
	return s
}
902185
func (s *SearchSource) DocvalueFields(docvalueFields ...string) *SearchSource {
	for _, f := range docvalueFields {
		s.docvalueFields = append(s.docvalueFields, DocvalueField{Field: f})
	}
	return s
}
206239
func (a *CompositeAggregationHistogramValuesSource) Field(field string) *CompositeAggregationHistogramValuesSource {
	a.field = field
	return a
}
839503
func fields(s string) ([]string, error) {
	var args []string

	for s = strings.TrimSpace(s); len(s) > 0; s = strings.TrimSpace(s) {
		if s[0] == '/' {
			sep := nextSlash(s[1:])
			if sep < 0 {
				return nil, errors.New("unbalanced /")
			}
			args, s = append(args, s[:sep+2]), s[sep+2:]
		} else {
			sep := strings.IndexByte(s[1:], ' ')
			if sep < 0 {
				return append(args, s), nil
			}
			args, s = append(args, s[:sep+1]), s[sep+1:]
		}
	}

	return args, nil
}
243085
func (c *Client) FieldCaps(indices ...string) *FieldCapsService {
	return NewFieldCapsService(c).Index(indices...)
}
640749
func (s *DeleteByQueryService) DocvalueFields(docvalueFields ...string) *DeleteByQueryService {
	s.docvalueFields = docvalueFields
	return s
}
1304477
func (b *backend) getConfigFieldData() (*framework.FieldData, error) {
	configPath := b.Route("config")

	if configPath == nil {
		return nil, logical.ErrUnsupportedPath
	}

	raw := make(map[string]interface{}, len(configPath.Fields))

	fd := framework.FieldData{
		Raw:    raw,
		Schema: configPath.Fields,
	}

	return &fd, nil
}
1326564
func GetFields(db *sql.DB, dbName string, tableName string) []Field {
	dbWrp := DBWrapper{db, dbName}
	res := dbWrp.Query(selectTableInfo, dbName, tableName)
	if res.Error != nil {
		return nil
	}
	fields := make([]Field, len(res.Rows))
	for i, row := range res.Rows {
		fName := row.Str(0)
		tName := row.Str(1)
		fType, ok := FieldTypeMap[tName]
		if !ok {
			// Try with lower case.
			fType, ok = FieldTypeMap[strings.ToLower(tName)]
		}
		if !ok {
			panic(fmt.Errorf("unsupported filed type(%s), consider configuring the FieldTypeMap to support it.", tName))
		}
		fields[i] = Field{Name: fName, Type: fType}
	}
	return fields
}
500767
func (a *DiversifiedSamplerAggregation) Field(field string) *DiversifiedSamplerAggregation {
	a.field = field
	return a
}
1251632
func (s *MultiTermvectorService) Fields(fields []string) *MultiTermvectorService {
	s.fields = fields
	return s
}
1210299
func (s *TermvectorsService) Fields(fields ...string) *TermvectorsService {
	if s.fields == nil {
		s.fields = make([]string, 0)
	}
	s.fields = append(s.fields, fields...)
	return s
}
916628
func (f *fieldHolder) AddField(key string, val interface{}) {
	f.lock.Lock()
	defer f.lock.Unlock()
	f.data[key] = val
}
703411
func (s *MultiTermvectorService) FieldStatistics(fieldStatistics bool) *MultiTermvectorService {
	s.fieldStatistics = &fieldStatistics
	return s
}
847416
func (v *Validator) Fields() []string {
	fields := []string{}
	for _, vr := range v.results {
		fields = append(fields, vr.field)
	}
	return fields
}
342837
func setFields(fieldValue reflect.Value, val parse.Parser) error {
	if fieldValue.CanSet() {
		fieldValue.Set(reflect.ValueOf(val).Elem().Convert(fieldValue.Type()))
	} else {
		return fmt.Errorf("%s is not settable", fieldValue.Type().String())
	}
	return nil
}
1049476
func Fields(cfg *Config, words ...*syntax.Word) ([]string, error) {
	cfg = prepareConfig(cfg)
	fields := make([]string, 0, len(words))
	dir := cfg.envGet("PWD")
	for _, word := range words {
		afterBraces := []*syntax.Word{word}
		if w2 := syntax.SplitBraces(word); w2 != word {
			afterBraces = Braces(w2)
		}
		for _, word2 := range afterBraces {
			wfields, err := cfg.wordFields(word2.Parts)
			if err != nil {
				return nil, err
			}
			for _, field := range wfields {
				path, doGlob := cfg.escapedGlobField(field)
				var matches []string
				if doGlob && cfg.ReadDir != nil {
					matches, err = cfg.glob(dir, path)
					if err != nil {
						return nil, err
					}
					if len(matches) > 0 {
						fields = append(fields, matches...)
						continue
					}
				}
				fields = append(fields, cfg.fieldJoin(field))
			}
		}
	}
	return fields, nil
}
789656
func (i *Index) Fields() []*Field {
	i.mu.RLock()
	defer i.mu.RUnlock()

	a := make([]*Field, 0, len(i.fields))
	for _, f := range i.fields {
		a = append(a, f)
	}
	sort.Sort(fieldSlice(a))

	return a
}