In the previous blog post, we learned how to install Wiki.js in Openshift.
By default, Wiki.js enables the basic search engine, which can only search into document titles. Some additional modules are available, to improve the search feature.
Some modules leverage cloud services (often with a montly fee); in this post I’ll explain how to use the Elasticsearch module, running a single node instance in the same namespace Wiki.js is running.
1. Elastic
Let’s use an Elasticsearch docker image cerfiied by Redhat.
Wiki.js only supports version 6.x and 7.x for Elastic, while in the moment I’m writing the latest tag points to version 8.2.
It’s therefore important to specify the exact tag:
oc new-app --docker-image=registry.connect.redhat.com/elastic/elasticsearch:7.17.2
To be able to execute the image in single-node mode, you have to specify an environment variable:
oc set env deploy elasticsearch discovery.type=single-node
After having entered the two commands, the Elasticsearch POD should be up and running.
2. Wiki.js
The configuration of Wiki.js is straightforward: from the Administration panel, choose Search Engines, then Elasticsearch:
Having installed Elastic in the same Openshift cluster, you can point to its service in the URL:
Confirm the new settings with Apply, then make sure to click on Rebuild index to initialize the index in Elastic.
The full-text search is now available for your Wiki!