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.

4 2 votes
Article Rating
Subscribe
Notify of
guest

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

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Serge
Serge
2 years ago

Hello Mr. Hermann. Thank you for the article. After installing the plugin + owncloud Indexed search, I receive the error in Owncloud search settings: unknown key [index] for create index. in my case owncloud and elasticsearch run on one VPS. So I skipped the following: — 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 — If I need to perform these steps, what should I indicate as CLIENT-IP? 127.0.0.1? any… Read more »

Снимок экрана 2021-11-27 в 09.54.51.png
Last edited 2 years ago by Serge
Serge
Serge
2 years ago

Thank you for the article!
Just a note: Elasticsearch version must be <=5.6.16 (until the app version is 1.0.0)