Main Answer: Elasticsearch provides Liferay DXP with fast, scalable search capabilities. Custom connection configurations and index mapping adjustments ensure optimal portal search speeds.
Audience: Search engineers, database administrators, and Liferay platform architects.
Applicable Use Cases: Configuring remote Elasticsearch clusters, optimizing portal global searches, and tuning custom search queries.
| Setting Key | Default Value | Production Recommendation |
|---|---|---|
| clusterName | LiferayElasticsearchCluster | Unique cluster name for safety |
| transportAddresses | localhost:9300 | Comma-separated remote cluster IPs |
| indexNamePrefix | liferay- | Custom prefix to separate environments |
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.