Elasticsearch
Elasticsearch | |
---|---|
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 - Elasticsearch Backend Plugin
This plugin allows Moodle to use Elasticsearch as the search engine for Moodle's Global Search.
The following features are provided by this plugin:
- Multiple versions of Elasticsearch
- File indexing
- Request signing, compatible with Amazon Web Services (AWS)
- Respects Moodle Proxy settings
- Image recognition and indexing
- Webservices
Supported Moodle Versions
This plugin currently supports Moodle:
- 3.1
- 3.2
- 3.3
Installation
NOTE: Complete all of these steps before trying to enable the Global Search functionality in Moodle.
- Get the code and copy/ install it to:
<moodledir>/search/engine/elastic
- This plugin also depends on local_aws get the code from https://github.com/catalyst/moodle-local_aws and copy/ install it into
<moodledir>/local/aws
- Run the upgrade: :
sudo -u www-data php admin/cli/upgrade
Note: the user may be different to www-data on your system. - Set up the plugin in Site administration > Plugins > Search > Manage global search by selecting elastic as the search engine.
- Configure the Elasticsearch plugin at: Site administration > Plugins > Search > Elastic
- Set hostname and port of your Elasticsearch server
- Optionally, change the Request size variable. Generally this can be left as is. Some Elasticsearch providers such as AWS have a limit on how big the HTTP payload can be. Therefore we limit it to a size in bytes.
- To create the index and populate Elasticsearch with your site's data, run this CLI script.:
sudo -u www-data php search/cli/indexer.php --force
- Enable Global search in Site administration > Advanced features
Elasticsearch Version Support
Currently this plugin is tested to work against the following versions of Elasticsearch:
- 2.3.4
- 2.4.4
- 5.1.2
- 5.5.0
Elasticsearch Setup
The following is the bare minimum to get Elasticsearch working in a Debian/Ubuntu Operating System environment. Consult the Elasticsearch Documention for in depth instructions, or for details on how to install on other operating systems.
NOTE: The instructions below should only be used for test and dev purposes. Don't do this in production.
Elasticsearch requires Java as a prerequisite, to install Java:
sudo apt-get install default-jre default-jdk
Once Java is installed, the following commands will install and start Elasticsearch.
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.2.deb
sudo dpkg -i elasticsearch-5.1.2.deb
sudo update-rc.d elasticsearch defaults
sudo service elasticsearch start
A quick test can be performed by running the following from the command line.
curl -X GET 'http://localhost:9200'
The output should look something like:
{
"name" : "1QHLiux",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "mLRqIsnVRrGdgg2OfHWNrg",
"version" : {
"number" : "5.1.2",
"build_hash" : "c8c4c16",
"build_date" : "2017-01-11T20:18:39.146Z",
"build_snapshot" : false,
"lucene_version" : "6.3.0"
},
"tagline" : "You Know, for Search"
}