// Field is the field to be used for random number generation.
// This parameter is compulsory when a Seed is set and ignored
// otherwise. Note that documents that have the same value for a
// field will get the same score.
907
func (fn *RandomFunction) Field(field string) *RandomFunction {
	fn.field = field
	return fn
}
1198762
func (q *PrefixQuery) Field(field string) *PrefixQuery {
	q.options["field"] = field
	return q
}
1077600
func (m *ImageUpdate) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "name":
		return string(m.Name), len(m.Name) > 0
	case "labels":
		// Labels fields have been special-cased by name. If this breaks,
		// add better special casing to fieldpath plugin.
		if len(m.Labels) == 0 {
			return "", false
		}
		value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
		return value, ok
	}
	return "", false
}
1361168
func (logger *Logger) SetField(key string, value interface{}) {
	logger.Fields[key] = value
}
853088
func (m *TaskExecAdded) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "container_id":
		return string(m.ContainerID), len(m.ContainerID) > 0
	case "exec_id":
		return string(m.ExecID), len(m.ExecID) > 0
	}
	return "", false
}
504530
func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "digest":
		return string(m.Digest), len(m.Digest) > 0
	}
	return "", false
}
780285
func (a *CompositeAggregationDateHistogramValuesSource) Field(field string) *CompositeAggregationDateHistogramValuesSource {
	a.field = field
	return a
}
914631
func Field(pointerToAField interface{}, rigthOperand ...Expression) (exp Expression) {
	if len(rigthOperand) == 0 {
		return &FieldExpression{pointerToAField, nil}
	}
	return &FieldExpression{pointerToAField, rigthOperand[0]}
}
943853
func (e *Envelope) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: timestamp
	case "namespace":
		return e.Namespace, len(e.Namespace) > 0
	case "topic":
		return e.Topic, len(e.Topic) > 0
	case "event":
		decoded, err := typeurl.UnmarshalAny(e.Event)
		if err != nil {
			return "", false
		}

		adaptor, ok := decoded.(interface {
			Field([]string) (string, bool)
		})
		if !ok {
			return "", false
		}
		return adaptor.Field(fieldpath[1:])
	}
	return "", false
}
558270
func (m *TaskDelete) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: pid
	// unhandled: exit_status
	// unhandled: exited_at
	case "container_id":
		return string(m.ContainerID), len(m.ContainerID) > 0
	case "id":
		return string(m.ID), len(m.ID) > 0
	}
	return "", false
}
272618
func (b *CollapseBuilder) Field(field string) *CollapseBuilder {
	b.field = field
	return b
}
916628
func (f *fieldHolder) AddField(key string, val interface{}) {
	f.lock.Lock()
	defer f.lock.Unlock()
	f.data[key] = val
}
324406
func (m *TaskIO) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "stdin":
		return string(m.Stdin), len(m.Stdin) > 0
	case "stdout":
		return string(m.Stdout), len(m.Stdout) > 0
	case "stderr":
		return string(m.Stderr), len(m.Stderr) > 0
	case "terminal":
		return fmt.Sprint(m.Terminal), true
	}
	return "", false
}
471332
func Seed(seed int64) ListOption {
	return listOptionFunc(func(options *listOptions) {
		options.seed = seed
	})
}
1355259
func (q *QueryStringQuery) Field(field string) *QueryStringQuery {
	q.fields = append(q.fields, field)
	return q
}
993156
func getField(field string, r bounds) (uint64, error) {
	var bits uint64
	ranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' })
	for _, expr := range ranges {
		bit, err := getRange(expr, r)
		if err != nil {
			return bits, err
		}
		bits |= bit
	}
	return bits, nil
}
325397
func (f *FieldSetType) Field(name string) fields.FieldInterface {
	ind, ok := f.fieldMap[name]
	if !ok {
		return &fields.Field{}
	}
	return f.fields[ind].(fields.FieldInterface)
}