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

fallback to empty array if no _source in hit #2992

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

pschoffer
Copy link
Contributor

Description of the Change

Adding a null check to $hit[_source] for instances when source is not returned.

This scenario happens for instance in our count validation logic. We by design suppress _source which includes documents' content to limit the amount of data needed to transfer as we are only interested in count in that specific scenario.

How to test the Change

  1. vip dev-env exec -- wp vip-search health validate-counts
  2. No warnings

Changelog Entry

Fixed - Warning if _source is not returned in query hit

Credits

@pschoffer

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@felipeelia felipeelia added this to the 4.4.0 milestone Oct 17, 2022
@felipeelia felipeelia merged commit 926fa3b into 10up:develop Oct 17, 2022
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.

2 participants