[HZ-341] Fix Solr cron full-indexing functionality#1673
Merged
nkissebe merged 3 commits intohubzero:devfrom Oct 5, 2023
Merged
[HZ-341] Fix Solr cron full-indexing functionality#1673nkissebe merged 3 commits intohubzero:devfrom
nkissebe merged 3 commits intohubzero:devfrom
Conversation
nkissebe
approved these changes
Oct 5, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The core plugin
plgCronSolris meant to provide full and queue-based Solr reindexing of Hub components via Hubzero cron. The plugin'srunFullIndex()function for full reindexing of all indexed Solr content was buggy and did not reindex Hub content as expected. This PR repairs that functionality.This work is described in Jira Card #HZ-341.
Fix details
The following issues are addressed:
runFullIndex()function should callindexSearchResults()for each indexed component, and should return a boolean when all indexing is complete$recordsIndexed['offset']in components/com_search/admin/controllers/searchable.php prior to accessing the variable.Note
Previous PRs have corrected 500 errors thrown by this plugin (See #1586). The present PR builds on this earlier work by fixing the reindexing functionality. An additional function is roughed out in this plugin to enable queue-based indexing of components. This will be implemented in future work, as it is also non-functional at present (see [HZ-342]).
Motivation
The
plgCronSolrplugin'srunFullIndex()function could not be run reliably via Hubzero cron as designed. It only intermittently indexed components; it attempted to index components not configured for indexing; and it did not return a boolean, as required by Hubzero cron.From the Google Doc called “Search improvements for hubzero platform”:
Testing
This work was tested by scheduling the Solr Full Index option via Hubzero cron for various configurations of enabled and disabled components. During testing, monitoring various logs and database tables to ensure that the reindexing occurred as specified.
Testing is performed using the admin back-end to set up Solr indexing and Hubzero cron full-indexing; using terminals to monitor logs; and querying database tables.
For Solr administration, access the admin interface, Components:Search, then Searchable Components. Indexing is enabled on a given component (e.g. Groups or Resources) by clicking its "Active" icon. The Records column for a component indicates the number of records currently indexed in Solr.
Logs:
/var/log/hubzero-solr/solr.log(may be found in/srv/hubzero-solr/logs/, in which case symlink needed)/var/log/hubzero-cms/hub-cmscron.logDatabase tables:
jos_cron_jobscontains cron jobs and their status and schedulesjos_solr_search_searchcomponentsshould show indexed components, index item countsOther
No hotfix is needed. Review will be assigned to Nick and Dave.
Out of scope
Other findings were noted on undertaking this work. These should be scoped separately:
components/com_search/admin/controllers/searchable.phpindexed) and actual record count (indexed_records) in thejos_solr_search_searchcomponentstable