Operating Liferay 7.4 GA/Update 81+ with Elasticsearch 8

Allowing deployments to upgrade their Elastic Stack to 8.x (opt-in), while also keeping the compatibility with Elasticsearch 7.x.

Starting with Liferay Portal 7.4 CE GA81 and Liferay DXP 7.4 Update 81, on-premise deployments can operate with Elasticsearch 8 as the search engine.

This capability is provided by leveraging the REST API compatibility mode of Elasticsearch 8 through the bundled Elasticsearch 7 connector and other enhancements implemented for Elasticsearch-only features like Commerce, Workflow Metrics or Search Tuning.

Why to choose Elasticsearch 8?

Operating your Liferay deployment with Elasticsearch 8 comes with benefits like running on the latest and most secure version of Elasticsearch that's actively maintained and enhanced through minor releases.

The initial release introduced significant improvements in speed, scale and relevance; and the subsequent releases, like the current latest available minor version (8.8) continue to delivering on these areas.

How to switch to Elasticsearch 8?

The recommended path is to upgrade the existing Elasticsearch 7 cluster to 8.x. The biggest advantage of upgrading the current Elasticsearch stack is that this way a full Liferay reindex can be avoided.

For Elasticsearch 8, if there is a firewall or proxy between Liferay and Elasticsearch, make sure the compatibility HTTP headers Liferay sets on each request are allowed and preserved in the network traffic. Refer to Elasticsearch’s Requesting REST API Compatibility for more information.​​​​​​​

When setting-up and connecting Liferay to a new Elasticsearch 8 cluster an initial system wise reindex is inevitable.

Is Elasticsearch 7 still available?

Yes, it is still a compatible version. No action is required for deployments already using and insisting to stay on Elasticsearch 7.x. All these changes made are expected to be backward compatible with Elasticsearch 7.x. However, it is recommended to upgrade to Elasticsearch 8.

What are the compatible Elasticsearch versions?

The Search Engine Compatibility Matrix always includes the latest information to learn about the compatible search engines and GA/Update versions.

Liferay conducts ad-hoc testing of the Elasticsearch connectors with minor releases of Elasticsearch to ensure that Liferay features are also compatible with newer minor versions. As these minor releases sometimes introduce breaking changes, the compatibility matrix is updated only after successful iterations.

Does Liferay come with Elasticsearch 8 as the sidecar search engine?

There are a few challenges to be solved before Liferay could be bundled with a newer major search engine version. Until it happens, the Sidecar Elasticsearch server remains to be the latest available 7.17 version (7.17.10 at the time of writing this post).

Remember that while the bundled Elasticsearch servers are convenient for development and testing, neither is suitable for production, nor supported.

What's next?

Support for Elasticsearch 8 (in a similar way) is expected to become available for Liferay DXP 7.3 in Q3 of 2023 (subject to change).

Useful resources

The following documentation can provide further details on installing and upgrading Elasticsearch:

 

Blogs