Skip to content

Commit

Permalink
Add get('$.all_scores') and get('$.index') functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoznic committed Dec 4, 2024
1 parent 34c8604 commit afaf195
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions www/docs/learn/user-defined-function-reranker.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ get('$.score') * get('$.part_metadata.boost')
get('$.document_metadata.reviews[0].score', 0)
```

#### Get the full list of scores

The `$.all_scores` function retrieves the entire list of scores for all search
results in the current ranking. This is useful because it considers the
relevance of results in the overall list.

```sql
get('$.all_scores')
```
#### Get the index of the result

The `$.index` function retrieves the index of a result within its original
ranking. This is useful for implementing position-aware adjustments, such as
favoring higher-ranked results.

```sql
get('$.index')
```
## Time functions

The following table lists the available time functions that allow you to
Expand Down

0 comments on commit afaf195

Please sign in to comment.