Skip to content

Conversation

neilcook
Copy link

Currently both the include and exclude functionality of _source is available, but not disabling matching documents altogether, for example (as per https://docs.opensearch.org/latest/field-types/metadata-fields/source/):

"_source": {
  enabled: false
}

This PR adds the above functionality to SearchRequest, and also adds a test. Note that this only changes the query if source should be disabled, since the default is for it to be enabled.

@neilcook
Copy link
Author

BTW I'm thinking that setting exclude fields to "*" might achieve the same result, but probably at a much higher compute cost on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant