Azuresearch
Azuresearch | |
---|---|
Type | Search engines, Elasticsearch |
Set | N/A |
Downloads | https://moodle.org/plugins/search_elastic |
Issues | https://github.com/catalyst/moodle-search_elastic/issues |
Discussion | |
Maintainer(s) | Matt Porritt |
Moodle Global Search - Azure Search Backend
This plugin allows Moodle to use Microsoft Azure Search as the search engine for Moodle's Global Search.
The following features are provided by this plugin:
- File indexing
- Respects Moodle Proxy settings
Supported Moodle Versions
This plugin currently supports Moodle:
- 3.1
- 3.2
- 3.3
- 3.4
Azure Search Service Setup
Service Setup
To setup an Azure Search Service (and optionally a Microsoft Azure account), follow the instructions at: https://docs.microsoft.com/en-au/azure/search/search-create-service-portal
Get API Credentials
Calls to the Azure Search service require the service URL and an access key on every request. A search service is created with both, so if you added Azure Search to your subscription, follow these steps to get the necessary information:
- In the Azure portal, open the search service page from the dashboard or find your service in the service list.
- Get the endpoint at Overview > Essentials > Url. An example endpoint might look like https://my-service-name.search.windows.net.
- Get the api-key in Settings > Keys. There are two admin keys for redundancy in case you want to roll over keys. Admin keys grant the write permissions on your service, necessary for creating and loading indexes. You can use either the primary or secondary key for write operations.
Moodle Plugin Installation
Once you have setup an Azure Search service you can now install the Moodle plugin.
Command Line Installation
To install the plugin in Moodle via the command line:
- Get the code from GitHub or the Moodle Plugin Directory.
- Copy or clone code into:
<moodledir>/search/engine/azure
- Run the upgrade:
sudo -u www-data php admin/cli/upgrade
Note: the user may be different to www-data on your system.
User Interface Installation
To install the plugin in Moodle via the Moodle User Interface:
- Log into your Moodle as an Administrator.
- Navigate to: Site administration > Plugins > Install Plugins
- Install plugin from Moodle Plugin directory or via zip upload.
Moodle Plugin Setup
Once you have setup an Azure Search service you can now configure the Moodle plugin.
- Log into Moodle as an administrator
- Set up the plugin in Site administration > Plugins > Search > Manage global search by selecting azure as the search engine.
- Configure the Azure Search plugin at: Site administration > Plugins > Search > Azure
- Set URL, API Key and API version of your Elasticsearch server
- Set the Index name you want to use for your Azure Search service.
- To create the index and populate Azure Searcg with your site's data, run this CLI script. sudo -u www-data php search/cli/indexer.php --force --reindex
- Enable Global search in Site administration > Advanced features
File Indexing Support
This plugin provides optional file indexing support.
This plugin uses Apache Tika for file indexing support. This is a separate service to this plugin and core Moodle. Tika parses files, extracts the text, and return it via a REST API.
If you wish to use file indexing you will need access to a Tika service. An example setup can be found below.
Tika Setup
Setting up a Tika test service is straight forward. In most cases on a Linux environment, you can simply download the Java JAR then run the service.
wget http://apache.mirror.amaze.com.au/tika/tika-server-1.16.jar
java -jar tika-server-1.16.jar
This will start Tika on the host. By default the Tika service is available on: http://localhost:9998
Enabling File indexing support in Moodle
Once a Tika service is available the Azure Search plugin in Moodle needs to be configured for file indexing support.
Assuming you have already followed the basic installation steps, to enable file indexing support:
- Configure the Azure Search plugin at: Site administration > Plugins > Search > Azure
- Select the Enable file indexing checkbox.
- Set Tika hostname and Tika port of your Tika service. If you followed the basic Tika setup instructions the defaults should not need changing.
- Click the Save Changes button.
What is Tika
From the Apache Tika website:
The Apache Tika™ toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF). All of these file types can be parsed through a single interface, making Tika useful for search engine indexing, content analysis, translation, and much more. You can find the latest release on the download page. Please see the Getting Started page for more information on how to start using Tika.