RUAL Documentation

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.

Pin Pin Type Default
Queryrequired
The inner query to apply scoring functions to.
query
script params
Parameters passed to the script_score function (e.g. { interests: { technology: 12 } }).
object
script weight
Weight for the script_score function.
number 1
random weight
Weight for random_score function for discovery sprinkle.
number 0.15
decay type
Decay function type: exp, gauss, or linear.
value exp
decay field
Field to apply decay to.
value _meta.created
decay origin
Origin point for the decay function.
value now
decay scale
Scale for the decay function (e.g. 7d, 30d).
value 7d
decay value
Decay factor (0 to 1).
number 0.5
decay weight
Weight for the decay function.
number 0.3
score mode
How function scores are combined: multiply, sum, avg, first, max, min.
value sum
boost mode
How function score combines with query score: multiply, replace, sum, avg, max, min.
value replace
max boost
Caps the maximum effect of scoring functions.
number
Pin Pin Type Example
query
query

Core Releases

v14.0.4 This block was introduced in v14.0.4, click here to see the release notes.
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