Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
3.10
-
MOODLE_310_STABLE
-
MOODLE_310_STABLE
-
MDL-68729-master -
Description
Sometimes it is necessary to move a Solr installation, for example when upgrading to a new major version. This can involve reindexing everything.
Indexing can be a time-consuming operation, taking several days at least. (We think the current estimate on our site is about two weeks, although this is prior to MDL-68690.) It is not usually considered acceptable for search to stop working through the whole site for days or weeks, but at present there is no easy way around this.
Current behaviour after switch to new server:
- Initially students can search, but always get no results.
- Over a period of minutes, days, or weeks depending on the size of the site, the index is gradually rebuilt, starting from the oldest data. Students gradually start to get more results to global search queries.
- There is no advice to students about the situation.
I propose adding the ability to query from one server while indexing on another. Code-wise this is relatively simple: we just need to ensure that a particular server address is used for the query operations, and a different one for the indexing operation.
Proposed behaviour
- Students can search and get all results as of the time indexing started (e.g. minutes, days or weeks ago).
- Newer results, for example new forum posts, are not returned.
- When indexing catches up, the system is manually switched over and normal service resumes.
- A status message on search screens warns students about the current situation.
The current architecture doesn't support multiple search engines of the same type (and there's no good reason it should) so I decided it would be simplest to implement this as 'alternate configuration settings' within search engines that support the feature. This requires minimal modification to the actual search engine - one simple added function, a slight change to the constructor, and a copy-paste of the relevant connection settings in settings.php. I have implemented this for the Solr search engine in core. But even without this modification, you can still use this feature to switch between different types of search engine (e.g. simpledb->something else) with less disruption for students.
Attachments
Issue Links
- caused a regression
-
MDL-69477 PHP Notice: Undefined property: stdClass::$searchenginequeryonly
-
- Closed
-