hubzero / hubzero-cms

Platform for Scientific Collaboration
https://hubzero.org
GNU General Public License v2.0
46 stars 57 forks source link

[HZ-341] Fix Solr cron full-indexing functionality #1673

Closed jsperhac closed 11 months ago

jsperhac commented 12 months ago

Summary

The core plugin plgCronSolr is meant to provide full and queue-based Solr reindexing of Hub components via Hubzero cron. The plugin's runFullIndex() 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:

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 plgCronSolr plugin's runFullIndex() 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”:

Running the full index task originally picked the non-indexed component with the lowest unique id from jos_solr_search_searchcomponents, enabled it regardless of its state, and (re)indexed it.

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:

Database tables:

Other

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: