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 withcurl 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 startbin/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.
![](https://i0.wp.com/www.klocker-mark.eu/wp-content/uploads/2021/08/Bildschirmfoto_2021-08-25_um_08_52_28-1024x809.jpg?resize=640%2C506&ssl=1)
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.
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 »
Thank you for the article!
Just a note: Elasticsearch version must be <=5.6.16 (until the app version is 1.0.0)