// DocvalueFields specifies the list of fields to return as the docvalue representation of a field for each hit.
329415
func (s *UpdateByQueryService) DocvalueFields(docvalueFields ...string) *UpdateByQueryService {
	s.docvalueFields = docvalueFields
	return s
}
408020
func (s *SearchSource) Field(fieldName string) *SearchSource {
	if s.fieldNames == nil {
		s.fieldNames = make([]string, 0)
	}
	s.fieldNames = append(s.fieldNames, fieldName)
	return s
}
1004735
func (dt *DbfTable) FieldValueByName(row int, fieldName string) string {
	fieldName = strings.ToUpper(fieldName)
	fieldIndex, ok := dt.fieldMap[fieldName]
	if !ok {
		panic("Field name '" + fieldName + "' does not exist")
	}
	return dt.FieldValue(row, fieldIndex)
}
449903
func (d *Database) SomeValues(src interface{}, columns []string) ([]interface{}, error) {
	data, err := getFields(reflect.TypeOf(src))
	if err != nil {
		return nil, err
	}
	structVal := reflect.ValueOf(src).Elem()

	var values []interface{}
	for _, name := range columns {
		field, present := data.fields[name]
		if !present {
			// write null to the database
			values = append(values, nil)

			if Debug {
				log.Printf("meddler.SomeValues: column [%s] not found in struct", name)
			}
			continue
		}

		saveVal, err := field.meddler.PreWrite(structVal.Field(field.index).Interface())
		if err != nil {
			return nil, fmt.Errorf("meddler.SomeValues: PreWrite error on column [%s]: %v", name, err)
		}
		values = append(values, saveVal)
	}

	return values, nil
}
1251632
func (s *MultiTermvectorService) Fields(fields []string) *MultiTermvectorService {
	s.fields = fields
	return s
}
474352
func (r *SearchRequest) DocValueFields(fields ...string) *SearchRequest {
	r.searchSource = r.searchSource.DocvalueFields(fields...)
	return r
}
21703
func (s *SearchService) Fields(fields ...string) *SearchService {
	s.searchSource = s.searchSource.Fields(fields...)
	return s
}
1161557
func (p *point) Fields() (Fields, error) {
	if p.cachedFields != nil {
		return p.cachedFields, nil
	}
	cf, err := p.unmarshalBinary()
	if err != nil {
		return nil, err
	}
	p.cachedFields = cf
	return p.cachedFields, nil
}
357586
func (item *MoreLikeThisQueryItem) Fields(fields ...string) *MoreLikeThisQueryItem {
	item.fields = append(item.fields, fields...)
	return item
}
404442
func (s *MgetService) StoredFields(storedFields ...string) *MgetService {
	s.storedFields = append(s.storedFields, storedFields...)
	return s
}
1001128
func (s *Struct) structFields() []reflect.StructField {
	t := s.value.Type()

	var f []reflect.StructField

	for i := 0; i < t.NumField(); i++ {
		field := t.Field(i)
		// we can't access the value of unexported fields
		if field.PkgPath != "" {
			continue
		}

		// don't check if it's omitted
		if tag := field.Tag.Get(s.TagName); tag == "-" {
			continue
		}

		f = append(f, field)
	}

	return f
}
1272989
func (*DatabaseSettings) Fields(c context.Context) ([]portal.Field, error) {
	fields := []portal.Field{
		{
			ID:    "Server",
			Title: "Server",
			Type:  portal.FieldText,
			Help:  "<p>Server to use (for Cloud SQL should be of the form project:region:database)</p>",
		},
		{
			ID:    "Username",
			Title: "Username",
			Type:  portal.FieldText,
			Help:  "<p>Username to authenticate to the SQL database with</p>",
		},
		{
			ID:    "Password",
			Title: "Password",
			Type:  portal.FieldPassword,
			Help:  "<p>Password to authenticate to the SQL database with</p>",
		},
		{
			ID:    "Database",
			Title: "Database",
			Type:  portal.FieldText,
			Help:  "<p>SQL database to use</p>",
		},
	}
	return fields, nil
}
475000
func (prefs Preferences) CountFields(fieldName string) int {
	value, err := reflections.GetField(prefs, fieldName)
	count := 0
	if err != nil {
		return count
	}
	items, _ := reflections.Items(value)
	for i := range items {
		value, _ := reflections.GetField(value, i)
		if value != nil && value != "" {
			count++
		}
	}
	return count
}
1125229
func applyFields(event EventBuilder, values []interface{}) EventBuilder {
	for _, v := range values {
		switch t := v.(type) {
		case string:
			event = event.String(t)
		case []byte:
			event = event.String(string(t))
		default:
			panic(fmt.Sprintf("Expected string or field when creating an event, got %T", v))
		}
	}

	return event
}
855535
func (s *NodesStatsService) Fields(fields ...string) *NodesStatsService {
	s.fields = append(s.fields, fields...)
	return s
}
339437
func (s *SearchService) NoStoredFields() *SearchService {
	s.searchSource = s.searchSource.NoStoredFields()
	return s
}
42270
func (s *SearchSource) FieldDataFields(fieldDataFields ...string) *SearchSource {
	s.fieldDataFields = append(s.fieldDataFields, fieldDataFields...)
	return s
}