Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -369,35 +369,50 @@ The `DECAY_FUNCTION` determines the shape of the decay:
`gauss`
: Normal decay, computed as:

![Gaussian](../images/Gaussian.png "")

where ![sigma](../images/sigma.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset`
:::{math}
S(doc) = exp \left( - \dfrac{max(0, | fieldvalue_{doc} - origin| - offset)^2)}{ 2\sigma^2 } \right)
:::

where $\sigma$ is computed to assure that the score takes the value `decay` at distance `scale` from `origin ± offset`

![sigma calc](../images/sigma_calc.png "")
:::{math}
\sigma^2 = -scale^2 / (2 \cdot ln(decay))
:::

See [Normal decay, keyword `gauss`](#gauss-decay) for graphs demonstrating the curve generated by the `gauss` function.


`exp`
: Exponential decay, computed as:

![Exponential](../images/Exponential.png "")

where again the parameter ![lambda](../images/lambda.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset`
:::{math}
S(doc) = exp(\lambda \cdot max(0, |fieldvalue_{doc} - origin| - offset))
:::

![lambda calc](../images/lambda_calc.png "")
where again the parameter $\lambda$ is computed to assure that the score takes the value `decay` at distance `scale` from `origin ± offset`

:::{math}
\lambda = ln(decay)/scale
:::

See [Exponential decay, keyword `exp`](#exp-decay) for graphs demonstrating the curve generated by the `exp` function.


`linear`
: Linear decay, computed as:

![Linear](../images/Linear.png "").

where again the parameter `s` is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset`
:::{math}
S(doc) = max \left( \dfrac{s - max(0, | fieldvalue_{doc} - origin| - offset)^2)}{ s }, 0 \right)
:::

where again the parameter `s` is computed to assure that the score takes the value `decay` at distance `scale` from `origin ± offset`

![s calc](../images/s_calc.png "")
:::{math}
s = scale / (1.0 - decay)
:::

In contrast to the normal and exponential decay, this function actually sets the score to 0 if the field value exceeds twice the user given scale value.

Expand Down