The Augmented Search module lets you use the power of Elasticsearch to index and search the contents of your Jahia websites. The module acts as connector to an existing Elasticsearch environment, by sending index data and search queries, and retrieving search results.
This module improves the relevance of the search results (compared to the default JCR search) as it includes a full-page search as opposed to a content-based search. It connects to an Elasticsearch cluster in version 7.X using the elasticsearch-connector-7 module.
Delegating the search capabilities to Elasticsearch has another advantage: Jahia consumes less resources, which improves the overall stability of the platform. You can also make most of the Elasticsearch scalability design. This was validated by our different performance tests, which showed significant improvement for edit operation response times. Smaller improvements regarding live browsing were also observed.
In all our performance test scenarios, the Elasticsearch search provider easily met our acceptance criterias, as 90% of the requests took 3 times less than the limit we set, without any special tuning or configuration on the Elasticsearch environment side. Elasticsearch as the search provider is more performant than JCR search in scenarios with a lot of searches combined with content contribution. However, in some other scenarios, with no contribution at all for instance, the JCR search scored slightly better than our Elasticsearch search provider. For this reason, before using this module in production, it is strongly advised to carefully test your Elasticsearch environment to ensure that your expected performance levels are met.
Augmented search offers:
The Elasticsearch search provider module currently supports Elasticsearch 7.4, available here. If your Elasticsearch cluster is using X-Pack, please consult our dedicated page related to X-Pack configuration.
The required modules can be deployed on your Jahia environment by using the Augmented Search - Distribution package available on our store, or by installing its modules individually:
In the Jahia administration UI, go into Configuration>Database Connector
Create a new connection, by clicking on the New connection button.
Select the elastic
database type.
Create a new Elasticsearch connection by filling the following settings:
If using X-Pack, open the Advanced tab, select Use XPack Security and enter a username and password (the default values are elastic/changeme).
Then the connection is created.
In Administration, go to Configuration>Elasticsearch management.
Verify that the Elasticsearch database connection ID corresponds to the one previously created (in our example "esConnection"), and click Save. This will trigger a reindexing of the platform.
It is possible to start reindexing from the same screen. A job will perform the reindexing in background.
Upon installation of the search-provider-elasticsearch module, a configuration file named org.jahia.modules.augmentedsearch.cfg
is created under digital-factory-data/karaf/etc/ . This configuration file is used to specify the types of contents that need to be indexed in Elasticsearch. Whenever you modify this file in a Jahia cluster environment, the synchronization does not happen automatically, so you have to copy the modified file to each cluster node.
The indexing and the way to return results with Elasticsearch are done differently from the default JCR search provider. The JCR search provider indexes each content individually, then an aggregation is performed when collecting the search results. On the other side, the Eleasticsearch search provider already aggregates in the index contents which are displayable in full page: pages (jnt:page) and contents which come with a content template (e.g. jnt:news).
By default, only pages are indexed.
org.jahia.services.search.provider.elasticsearch.content.indexedMainResourceTypes
defines the list of content types that can be indexed as full page contents. These content types need to have corresponding content templates in order to be displayed individually, like "pages". Only content templates without restriction (mode / user / permissions), which are set in the studio, can be used to index content.
Only fulltext and metadata are indexed by default. If you want to do a search on a specific property you have to list it in:
org.jahia.services.search.provider.elasticsearch.content.mappedNodeTypes
By default, only the contents which have the jmix:editorialContent as supertype are indexed as subnodes of main resource (pages or contents with a content template).
Other content types can be indexed by listing them in:
org.jahia.services.search.provider.elasticsearch.content.indexedSubNodeTypes