mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-08 04:18:32 +02:00
time boosting example
This commit is contained in:
committed by
Jenny
parent
020024aea2
commit
13ed6b91b7
@@ -192,6 +192,20 @@ In this case we use a **gauss_decay** function.
|
||||
|
||||
{{< code-snippet path="/documentation/headless/snippets/query-points/score-boost-closer-to-user/" >}}
|
||||
|
||||
### Time-based score boosting
|
||||
|
||||
Or combine the score with how close the point's timestamp is to a target datetime (for example, the time of search).
|
||||
|
||||
If each point has a datetime field in its payload, f.e. the time the point was uploaded or last updated, we can calculate the time difference between this value and the target (in seconds).
|
||||
|
||||
Using an exponential decay function, we can convert this time difference into a value between 0 and 1, then add it to the original score to prioritize results closer in time to the target.
|
||||
|
||||
`score = score + exp_decay(target_time - x_time)`
|
||||
|
||||
In this case, we use an **exp_decay** function.
|
||||
|
||||
{{< code-snippet path="/documentation/headless/snippets/query-points/score-boost-time/" >}}
|
||||
|
||||
For all decay functions, there are these parameters available
|
||||
|
||||
| Parameter | Default | Description |
|
||||
|
||||
Reference in New Issue
Block a user