Install Elasticsearch for Koha

Zebra is the default search engine with Koha. Koha project preparing to adopt Elasticsearch as the default search in the near future. Koha users can try Elasticsearch with Koha. Elasticsearch offers speed and more functionality than its counterparts and is considered an innovative search engine suitable to match the latest requirements. 

Here is the installation manual of Elasticsearch for Koha. I prepared this manual by receiving inspiration from the installation manual prepared by Dr Mohan Raj Pradhan, Professor (Retired), Department of Library and Information Science, Tribhuvan University, Nepal. I tried the installation of ElasticSearch on Ubuntu 20.04 LTS. Install the Koha before the implementation of Elasticsearch. Try the Elasticsearch installation on a test machine, not on Koha production computer.

Install the Koha dependencies and the Java JDK

sudo apt install koha-elasticsearch openjdk-11-jdk-headless

Installation of Elasticsearch

Elasticsearch 7 is the latest version. But Koha is not ready to adopt version 7. Koha uses Elasticsearch version 6.
sudo wget -qO - | sudo apt-key add -
sudo echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch

Configure Elasticsearch for auto start

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

Install the analysis-icu plugin

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu

Restart the Elasticsearch server

sudo systemctl start elasticsearch.service

Check running status of Elasticsearch

Wait a few seconds then check if it is running correctly
sudo apt install curl
curl localhost:9200
curl http://localhost:9200/_cluster/health?pretty

Check installed Elasticsearch version

cd /usr/share/elasticsearch
sudo ./bin/elasticsearch --version

Change Search engine in Koha

Administration > Global system preferences > Administration > Search engine.

Rebuild search index

sudo koha-elasticsearch --rebuild -d library

No comments:

Post a Comment