function score
This block is part of the query group and was last modified in core v14.0.4.
Connection Type
This block connects from a query type block. Make sure to connect this block to the appropriate left-hand side connection.
function score v14.0.4 Wraps a query with function_score for custom relevance scoring. Builds script_score, random_score and decay functions from pins. The script_score scores documents by matching their tags field against the provided params : documents without a tags field return a neutral score of 1.
- Query required
queryThe inner query to apply scoring functions to.
- script params
objectParameters passed to the script_score function (e.g. { interests: { technology: 12 } }).
- script weight
numberWeight for the script_score function.
- random weight
numberWeight for random_score function for discovery sprinkle.
- decay type
valueDecay function type: exp, gauss, or linear.
- decay field
valueField to apply decay to.
- decay origin
valueOrigin point for the decay function.
- decay scale
valueScale for the decay function (e.g. 7d, 30d).
- decay value
numberDecay factor (0 to 1).
- decay weight
numberWeight for the decay function.
- score mode
valueHow function scores are combined: multiply, sum, avg, first, max, min.
- boost mode
valueHow function score combines with query score: multiply, replace, sum, avg, max, min.
- max boost
numberCaps the maximum effect of scoring functions.
- query
query
A typical wiring for function score: fields feeds the query pin; the query out pin feeds cast to object.

Version history
Introduced in v14.0.4.
Back to
query Return to the main group to view all sub-groups Back to query Return to the group to view all blocks within this group
