IQSS/11069 fix index status query #11072
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it: This PR fixes the query used in the admin/index/status API call. A last minute change to the query in #10710 added during review used a feature only allowed in native queries. The change in this PR adapts the query to use native syntax to fix the /index/status call.
It also fixes two other issues that can break the status call and indexing in general for single value fields used with a cvoc script. In both cases, an 'else if' is needed rather than a 'if' in the code. In the status case this resulted in a null pointer exception when orphan permission docs exist. In the latter, two code sections were adding the same field to the solr document. With a single/non-multi field (e.g. depositor) this resulted in multiple values in a single-value solr field.
Which issue(s) this PR closes:
Special notes for your reviewer: The PR also drops some per-file logging to finest to simplify debugging.
Suggestions on how to test this: Try the api/admin/index/status call, verify that it completes and provides a report in the server.log. For the orphan permission error - there shouldn't be a null pointer reported in server.log when there are orphan permission docs. If your repository doesn't have any, I'm not sure it's worth trying to generate them. For the cvoc error, I think the external cvoc config in use on demo, which should have the depositor field associated with the ORCID script, should show the problem. (The problem doesn't appear in v6.4 for some reason afaik, but some change in 6.5 has surfaced the issue.) In addition to seeing the dataset indexed when a depositor entry exists, you can also look for any logs in the logs/process-failures subdirectory. There should not be any related to the dataset being tested.)
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: