Search · AMP

Configuring Elasticsearch in Liferay DXP for Enterprise Search

Ankita Varani · Published May 25, 2026 · 9 min read · View full version

Quick answer

To optimize search, decouple Elasticsearch from the Liferay JVM. Deploy a dedicated Elasticsearch cluster, configure Liferay's Elasticsearch connector in System Settings with cluster nodes, adjust custom mappings and synonyms, and use index scaling to keep latency under 50ms.

Standalone Elasticsearch Setup

By default, Liferay runs an embedded Elasticsearch instance in its JVM. While convenient for local development, this configuration is a single point of failure in production. A production load will quickly deplete JVM resources, causing OutOfMemory crashes. A dedicated Elasticsearch cluster isolates search operations and scales independently.

Configure the connector by adding com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config to your config folder with nodes defined:

# Elasticsearch remote connection settings
networkAddress="http://10.0.1.50:9200,http://10.0.1.51:9200"
clusterName="liferay-cluster"
operationMode="REMOTE"

Custom Mappings and Tuning

Out-of-the-box analyzers perform general language queries. For enterprise domains, configure custom index mappings. Define custom analyzers, filters, and synonyms to ensure terms like "DXP" and "Digital Experience Platform" resolve to identical documents, matching user expectations.

Optimizing Search Performance

Keep your search index optimized by configuring index shard allocations. Set the number of shards to match the number of data nodes, and run routine segment merges. Restrict index fields to exclude unused metadata columns, ensuring sub-50ms query response times under high concurrent traffic.

Frequently asked questions

Should Elasticsearch run embedded or standalone in production?

Always run standalone Elasticsearch in production. Embedded search is resource-heavy, risks JVM memory crashes, and is only meant for development.

What version of Elasticsearch does Liferay DXP 7.4 support?

Liferay DXP 7.4 supports Elasticsearch 7.x (typically 7.17+) and Elasticsearch 8.x, depending on the connector patch levels deployed.

Read the full article, with table of contents, comparison table, and author bio →