Skip to content

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Sep 25, 2025

This change ensures that the _source include and exclude patterns are applied as exceptions when exclude_vectors is enabled.

Previously, exclude_vectors was enforced independently of any explicitly defined include or exclude rules.

With this update, queries like:

{
  "_source": {
    "exclude_vectors": true,
    "includes": ["my_vector_field"]
  }
}

will correctly include my_vector_field, overriding the exclude_vectors parameter.

This change ensures that the `_source` `include` and `exclude` patterns are applied as exceptions when `exclude_vectors` is enabled.

Previously, `exclude_vectors` was enforced independently of any explicitly defined `include` or `exclude` rules.

With this update, queries like:

```json
{
  "_source": {
    "exclude_vectors": true,
    "includes": ["my_vector_field"]
  }
}
```
will correctly include my_vector_field, overriding the exclude_vectors parameter.
@jimczi jimczi requested a review from kderusso September 25, 2025 14:47
@jimczi jimczi added >non-issue :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v9.2.0 labels Sep 25, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search - Relevance The Search organization Search Relevance team label Sep 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

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 with one comment about tests

@jimczi jimczi merged commit 763bfe3 into elastic:main Sep 25, 2025
34 checks passed
@jimczi jimczi deleted the exclude_vectors_include_exclude branch September 25, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants