func (fn *LinearDecayFunction) GetWeight() *float64 {
	return fn.weight
}
GetWeight returns the adjusted score. It is part of the ScoreFunction interface.
Returns nil if weight is not specified.
package elastic
import (
	"strings"
)
type ScoreFunction interface {
	Name() string
	GetWeight() *float64  
	Source() (interface{}, error)
}
type ExponentialDecayFunction struct {
	fieldName      string
	origin         interface{}
	scale          interface{}
	decay          *float64
	offset         interface{}
	multiValueMode string
	weight         *float64
}
func NewExponentialDecayFunction() *ExponentialDecayFunction {
	return &ExponentialDecayFunction{}
}
func (fn *ExponentialDecayFunction) Name() string {
	return "exp"
}
func (fn *ExponentialDecayFunction) FieldName(fieldName string) *ExponentialDecayFunction {
	fn.fieldName = fieldName
	return fn
}
func (fn *ExponentialDecayFunction) Origin(origin interface{}) *ExponentialDecayFunction {
	fn.origin = origin
	return fn
}
func (fn *ExponentialDecayFunction) Scale(scale interface{}) *ExponentialDecayFunction {
	fn.scale = scale
	return fn
}
func (fn *ExponentialDecayFunction) Decay(decay float64) *ExponentialDecayFunction {
	fn.decay = &decay
	return fn
}
func (fn *ExponentialDecayFunction) Offset(offset interface{}) *ExponentialDecayFunction {
	fn.offset = offset
	return fn
}
func (fn *ExponentialDecayFunction) Weight(weight float64) *ExponentialDecayFunction {
	fn.weight = &weight
	return fn
}
func (fn *ExponentialDecayFunction) GetWeight() *float64 {
	return fn.weight
}
func (fn *ExponentialDecayFunction) MultiValueMode(mode string) *ExponentialDecayFunction {
	fn.multiValueMode = mode
	return fn
}
func (fn *ExponentialDecayFunction) Source() (interface{}, error) {
	source := make(map[string]interface{})
	params := make(map[string]interface{})
	source[fn.fieldName] = params
	if fn.origin != nil {
		params["origin"] = fn.origin
	}
	params["scale"] = fn.scale
	if fn.decay != nil && *fn.decay > 0 {
		params["decay"] = *fn.decay
	}
	if fn.offset != nil {
		params["offset"] = fn.offset
	}
	if fn.multiValueMode != "" {
		source["multi_value_mode"] = fn.multiValueMode
	}
	return source, nil
}
type GaussDecayFunction struct {
	fieldName      string
	origin         interface{}
	scale          interface{}
	decay          *float64
	offset         interface{}
	multiValueMode string
	weight         *float64
}
func NewGaussDecayFunction() *GaussDecayFunction {
	return &GaussDecayFunction{}
}
func (fn *GaussDecayFunction) Name() string {
	return "gauss"
}
func (fn *GaussDecayFunction) FieldName(fieldName string) *GaussDecayFunction {
	fn.fieldName = fieldName
	return fn
}
func (fn *GaussDecayFunction) Origin(origin interface{}) *GaussDecayFunction {
	fn.origin = origin
	return fn
}
func (fn *GaussDecayFunction) Scale(scale interface{}) *GaussDecayFunction {
	fn.scale = scale
	return fn
}
func (fn *GaussDecayFunction) Decay(decay float64) *GaussDecayFunction {
	fn.decay = &decay
	return fn
}
func (fn *GaussDecayFunction) Offset(offset interface{}) *GaussDecayFunction {
	fn.offset = offset
	return fn
}
func (fn *GaussDecayFunction) Weight(weight float64) *GaussDecayFunction {
	fn.weight = &weight
	return fn
}
func (fn *GaussDecayFunction) GetWeight() *float64 {
	return fn.weight
}
func (fn *GaussDecayFunction) MultiValueMode(mode string) *GaussDecayFunction {
	fn.multiValueMode = mode
	return fn
}
func (fn *GaussDecayFunction) Source() (interface{}, error) {
	source := make(map[string]interface{})
	params := make(map[string]interface{})
	source[fn.fieldName] = params
	if fn.origin != nil {
		params["origin"] = fn.origin
	}
	params["scale"] = fn.scale
	if fn.decay != nil && *fn.decay > 0 {
		params["decay"] = *fn.decay
	}
	if fn.offset != nil {
		params["offset"] = fn.offset
	}
	if fn.multiValueMode != "" {
		source["multi_value_mode"] = fn.multiValueMode
	}
	return source, nil
}
type LinearDecayFunction struct {
	fieldName      string
	origin         interface{}
	scale          interface{}
	decay          *float64
	offset         interface{}
	multiValueMode string
	weight         *float64
}
func NewLinearDecayFunction() *LinearDecayFunction {
	return &LinearDecayFunction{}
}
func (fn *LinearDecayFunction) Name() string {
	return "linear"
}
func (fn *LinearDecayFunction) FieldName(fieldName string) *LinearDecayFunction {
	fn.fieldName = fieldName
	return fn
}
func (fn *LinearDecayFunction) Origin(origin interface{}) *LinearDecayFunction {
	fn.origin = origin
	return fn
}
func (fn *LinearDecayFunction) Scale(scale interface{}) *LinearDecayFunction {
	fn.scale = scale
	return fn
}
func (fn *LinearDecayFunction) Decay(decay float64) *LinearDecayFunction {
	fn.decay = &decay
	return fn
}
func (fn *LinearDecayFunction) Offset(offset interface{}) *LinearDecayFunction {
	fn.offset = offset
	return fn
}
func (fn *LinearDecayFunction) Weight(weight float64) *LinearDecayFunction {
	fn.weight = &weight
	return fn
}