FunctionScore
Models the search-time FunctionScore message: a set of scoring Functions (e.g. boost rankers) plus score-option params such as boost_mode and function_mode. Pass it to a search option via WithFunctionScore().
type FunctionScore struct {
Functions []*Function
Params map[string]string
}
CONSTRUCTORS:
NewFunctionScore()Creates an empty FunctionScore.
BUILDER METHODS:
AddFunction(f *[Function](Function.md)) *FunctionScoreAppends a scoring function to the score.
WithParam(key string, value any) *FunctionScoreSets a score-option parameter key-value pair, converting the value to its string representation.
METHODS:
Clone() *FunctionScoreReturns a deep copy of the score: functions and params are copied so the returned score does not share mutable state with the source.
ProtoMessage() *schemapb.FunctionScoreReturns the corresponding protobuf FunctionScore message.
ReadProto(p *schemapb.FunctionScore) *FunctionScoreParses a protobuf FunctionScore into the struct.