Owncloud Full Text Search with Elasticsearch

Using Elasticsearch for Mahara was a very fine experience. After reviving my Owncloud installation (it somehow went away after dist-upgrading to Ubuntu 18.04) I stumbled across this subject. Knowing myself and knowing how useful such an option would be I managed to use my Elastic-Server for this project too. Along came preparation to use Elastic wherever possible. The steps are described here.

Open Elasticsearch to be used from another location

Firstly I opened my Elasticsearch installation on SERVER-IP to be used from another machine CLIENT-IP. This required only three changes:

Elastic-search has to be told: in /etc/elasticsearch/elasticsearch.yml add/change:
network.host: 0.0.0.0

Your Firewall has to allow two connections for CLIENT-IP, e.g.:
ufw allow proto tcp from CLIENT-IP to any port 6379
ufw allow from CLIENT-IP to any port 9200

After these changes you have to restart your elasticsearch — and be patient, I had to wait quite some seconds before I could test connection to Elastic from server and client with
curl SERVER-IP:9200

Configure Owncloud

As mentioned in documentation Elastic has to be equipped with a plugin. To do this go to installation directory, e.g. /usr/share/elasticsearch/ and start
bin/elasticsearch-plugin install ingest-attachment

Owncloud (10.8. at time of writing) has an app for searching to be found in the Tools section. After installing you can go to Settings and initialize your Index.

Reindexing requires a proper cron-job to be set up, which I did as usual in /etc/crontab:

*/2 * * * * www-data /var/www/owncloud/occ system:cron

As my server mostly does nothing /2 is ok, but /15 would be enough too.

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments