func (a *CompositeAggregationTermsValuesSource) Field(field string) *CompositeAggregationTermsValuesSource {
	a.field = field
	return a
}
Field to use for this source.
package elastic
type CompositeAggregation struct {
	after           map[string]interface{}
	size            *int
	sources         []CompositeAggregationValuesSource
	subAggregations map[string]Aggregation
	meta            map[string]interface{}
}
func NewCompositeAggregation() *CompositeAggregation {
	return &CompositeAggregation{
		sources:         make([]CompositeAggregationValuesSource, 0),
		subAggregations: make(map[string]Aggregation),
	}
}
func (a *CompositeAggregation) Size(size int) *CompositeAggregation {
	a.size = &size
	return a
}
func (a *CompositeAggregation) AggregateAfter(after map[string]interface{}) *CompositeAggregation {
	a.after = after
	return a
}
func (a *CompositeAggregation) Sources(sources ...CompositeAggregationValuesSource) *CompositeAggregation {
	a.sources = append(a.sources, sources...)
	return a
}
func (a *CompositeAggregation) SubAggregation(name string, subAggregation Aggregation) *CompositeAggregation {
	a.subAggregations[name] = subAggregation
	return a
}
func (a *CompositeAggregation) Meta(metaData map[string]interface{}) *CompositeAggregation {
	a.meta = metaData
	return a
}
func (a *CompositeAggregation) Source() (interface{}, error) {
	source := make(map[string]interface{})
	opts := make(map[string]interface{})
	source["composite"] = opts
	sources := make([]interface{}, len(a.sources))
	for i, s := range a.sources {
		src, err := s.Source()
		if err != nil {
			return nil, err
		}
		sources[i] = src
	}
	opts["sources"] = sources
	if a.size != nil {
		opts["size"] = *a.size
	}
	if a.after != nil {
		opts["after"] = a.after
	}
	if len(a.subAggregations) > 0 {
		aggsMap := make(map[string]interface{})
		source["aggregations"] = aggsMap
		for name, aggregate := range a.subAggregations {
			src, err := aggregate.Source()
			if err != nil {
				return nil, err
			}
			aggsMap[name] = src
		}
	}
	if len(a.meta) > 0 {
		source["meta"] = a.meta
	}
	return source, nil
}
type CompositeAggregationValuesSource interface {
	Source() (interface{}, error)
}
type CompositeAggregationTermsValuesSource struct {
	name      string
	field     string
	script    *Script
	valueType string
	missing   interface{}
	order     string
}
func NewCompositeAggregationTermsValuesSource(name string) *CompositeAggregationTermsValuesSource {
	return &CompositeAggregationTermsValuesSource{
		name: name,
	}
}