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 #172

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

pschoffer
Copy link

@pschoffer pschoffer commented Sep 9, 2022

Description

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.

Checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally (or has an appropriate fallback).
  • This change works and has been tested on a Go sandbox.
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • This change has the fix PRed upstream (if applicable). If not applicable, it has the relevant "// VIP: reason for the discrepancy with upstream" comment in places where the code is discrepant.

Upstream PR - 10up#2992

Steps to Test

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

@pschoffer pschoffer force-pushed the update/check_for_source branch from c7c4016 to 21bf391 Compare September 9, 2022 13:26
@rebeccahum rebeccahum merged commit 1cc44a3 into develop Sep 9, 2022
@rebeccahum rebeccahum deleted the update/check_for_source branch September 9, 2022 14:42
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