Skip to content

[8.19] New vector_rescore parameter as a quantized index type option (#124581) #127644

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

Merged
merged 3 commits into from
May 2, 2025

Conversation

benwtrent
Copy link
Member

@benwtrent benwtrent commented May 2, 2025

Backport

This will backport the following commits from main to 8.19:

Related: #127647

Questions ?

Please refer to the Backport tool documentation

…tic#124581)

This adds a new parameter to the quantized index mapping that allows
default oversampling and rescoring to occur.

This doesn't adjust any of the defaults. It allows it to be configured.
When the user provides `rescore_vector: {oversample: <number>}` in the
query it will overwrite it.

For example, here is how to use it with bbq:

```
PUT rescored_bbq
{
  "mappings": {
    "properties": {
      "vector": {
        "type": "dense_vector",
        "index_options": {
          "type": "bbq_hnsw",
          "rescore_vector": {"oversample": 3.0}
        }
      }
    }
  }
}
```

Then, when querying, it will auto oversample the `k` by `3x` and rerank
with the raw vectors.

```
POST _search
{
  "knn": {
    "query_vector": [...],
    "field": "vector"
  }
}
```

(cherry picked from commit b2c1c4e)
Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benwtrent benwtrent merged commit ea83e41 into elastic:8.19 May 2, 2025
15 checks passed
@benwtrent benwtrent deleted the backport/8.19/pr-124581 branch May 2, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants