-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE
-
MDL-61102-master -
Every time the search manager is instantiated (for example, when displaying a search query page), it checks the schema of the search engine. When using external hosting (rather than the search engine running on the same machine) this can take a significant amount of time. In our system (Moodle hosted on-site in Milton Keynes, search engine in AWS London, which is only about 50 miles geographically) it takes about 250ms to initialise the search engine in total if it checks the schema, compared to about 20ms if not.
Since our pages generally load in about a second, this is a significant increase in the loading time for search pages and might cause perceived slowness for students. We want the 'new' search to feel nice and fast.
It would be nice to reduce the stringency of this schema checking. My proposal is:
- On the admin-type pages and in cron, continue checking schema on every request.
- On the search page, check schema only if it has not been successfully checked within a certain time (I suggest 24 hours).
The idea is that if somebody changes search engine settings they are pretty much bound to go to the search areas page or the main global search page. Also if there is an error with search and indexing stops working (for instance) then either somebody should notice it in the cron logs, or they'll go to the search areas page to see what it's doing and then get the error there. And if somebody has just turned search on or whatever, and they try to go search, then since it doesn't have a successful check yet, it'll still check that time as well.