Skip to content

Document automatic vector exclusion from _source (knn_default_excludes) - #12979

Open
shatejas wants to merge 1 commit into
opensearch-project:mainfrom
shatejas:knn-auto-source-excludes-docs
Open

Document automatic vector exclusion from _source (knn_default_excludes)#12979
shatejas wants to merge 1 commit into
opensearch-project:mainfrom
shatejas:knn-auto-source-excludes-docs

Conversation

@shatejas

Copy link
Copy Markdown
Contributor

Add documentation for the knn_default_excludes system-generated search request processor, introduced in OpenSearch 3.8, which automatically excludes knn_vector fields from _source in search responses.

  • Add an "Automatically exclude vectors from search results" section to the vector search performance tuning page, covering how to enable the processor, default behavior, how to override it, and a note that scoring is unaffected because exclusion is applied on the fetch path.
  • Register knn_default_excludes in the system-generated search request processors table and add a related-documentation link.

Description

Describe what this change achieves.

Issues Resolved

Closes #[Replace this text, including the brackets, with the issue number. Leave "Closes #" so the issue is closed properly.]

Version

List the OpenSearch version to which this PR applies, e.g. 2.14, 2.12--2.14, or all.

Frontend features

If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions Bot added the Tech review PR: Tech review in progress label Aug 25, 2026
@github-actions

Copy link
Copy Markdown

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference).

@shatejas

Copy link
Copy Markdown
Contributor Author

@kolchfa-aws Can we put a backport 3.8 label for this please, Thanks!

Add documentation for the knn_default_excludes system-generated search
request processor, introduced in OpenSearch 3.8, which automatically
excludes knn_vector fields from _source in search responses.

- Add an "Automatically exclude vectors from search results" section to
  the vector search performance tuning page, covering how to enable the
  processor, default behavior, how to override it, and a note that
  scoring is unaffected because exclusion is applied on the fetch path.
- Register knn_default_excludes in the system-generated search request
  processors table and add a related-documentation link.

Signed-off-by: Tejas Shah <shatejas@amazon.com>
@shatejas
shatejas force-pushed the knn-auto-source-excludes-docs branch from b114729 to ca54e25 Compare August 25, 2026 23:34

Instead of manually specifying vector fields in `_source.excludes` on every request, you can let OpenSearch exclude them automatically. When enabled, the `knn_default_excludes` [system-generated search request processor]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/system-generated-search-processors/) inspects the index mappings for each search request, finds all `knn_vector` fields (including those nested in object or nested fields), and adds them to `_source.excludes` before the request runs. This reduces the search response payload without requiring any per-request configuration.

The processor is disabled by default. To enable it, add its factory, `knn_default_excludes_factory`, to the `cluster.search.enabled_system_generated_factories` cluster setting:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is it disabled by default? I thought we want to enable by default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There isn't a way to enable it by default, users can do that in opensearch.yml they create

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 3.8 Tech review PR: Tech review in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants