Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add a generic rescorer retriever based on the search request's rescore functionality #119023

Merged
merged 6 commits into from
Dec 19, 2024

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Dec 18, 2024

Backport

This will backport the following commits from main to 8.x:

…ore functionality (elastic#118585)

This pull request introduces a new retriever called `rescorer`, which leverages the `rescore` functionality of the search request.  
The `rescorer` retriever re-scores only the top documents retrieved by its child retriever, offering fine-tuned scoring capabilities.  

All rescorers supported in the `rescore` section of a search request are available in this retriever, and the same format is used to define the rescore configuration.  

<details>
<summary>Example:</summary>

```yaml
  - do:
      search:
        index: test
        body:
          retriever:
            rescorer:
              rescore:
                window_size: 10
                query:
                  rescore_query:
                    rank_feature:
                      field: "features.second_stage"
                      linear: { }
                  query_weight: 0
              retriever:
                standard:
                  query:
                    rank_feature:
                      field: "features.first_stage"
                      linear: { }
          size: 2
```

</details>

Closes elastic#118327

Co-authored-by: Liam Thompson <[email protected]>
@jimczi jimczi added >feature :Search Relevance/Ranking Scoring, rescoring, rank evaluation. backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v8.18.0 labels Dec 18, 2024
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine merged commit 940ef77 into elastic:8.x Dec 19, 2024
15 checks passed
@jimczi jimczi deleted the 118585_backport_8x branch December 19, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >feature :Search Relevance/Ranking Scoring, rescoring, rank evaluation. v8.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants