Moodle LMS Integration Tutorial
Moodle global search can use an Opensolr Index as its Solr server: students and teachers then search courses, forums and activities from one box. Setup takes five steps.
01 · What you need
Moodle 3.1 or newer, the version that brought global search.
The PHP Solr extension (PECL solr) on your Moodle web server. Moodle's Solr engine needs it; without it the Solr settings page says The Apache Solr PHP extension is not installed.
An Opensolr Index: its Host from the Info tab, and its username and password. A new index uses opensolr and your master API key: HTTP Basic Auth.
02 · Steps
Enable global search
Site administration › Advanced features: tick Enable global search and save.
Choose Solr
Site administration › Plugins › Search › Manage global search: set Search engine to Solr and save.
Enter the connection
Site administration › Plugins › Search › Solr. Host name: the Host of your index, without https://. Index name: the name of your index. Secure mode: ticked. Port: 443. HTTP authentication username and password: those of your index. Save.
Create the schema
Signed in as an administrator, open https://YOUR-MOODLE/search/engine/solr/setup_schema.php on the still empty index. Moodle adds its fields through the Solr Schema API and answers The schema is ready to be used. If Solr reports that the schema cannot be changed, switch the index to a managed schema first: Move from schema.xml to managed-schema.
Index
From the Moodle folder, run php search/cli/indexer.php (add --reindex to rebuild everything). After that, the scheduled task Global search indexing keeps the index up to date through the Moodle cron.
03 · Uploaded files
Enable file indexing, under File indexing settings on the Solr page, is on by default. It sends uploaded files to the /update/extract handler of the index. Keep it on only if that handler is set up in the solrconfig.xml of your Opensolr Index; otherwise untick it.
04 · Who sees what
Moodle checks every result against the permissions of the person searching before it shows it, so students only find what they are allowed to open.