Legacy Knowledge Base
Published Jul. 2, 2025

Elasticsearch Connector Configuration: Reference

Written By

Shimada Taro

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Elasticsearch is the default search engine in Liferay DXP 7.1.The Liferay Foundation suite includes an Elasticsearch adapter calledLiferay Connector to Elasticsearch 6.This adapter can be configured in the system settings or in the OSGi configuration file.The OSGi configuration file named com.liferay.portal.search.elasticsearch.configuration.ElasticsearchConfiguration.cfgis deployed to[Liferay_Home]/osgi/configs.

Below is a list of Liferay's Elasticsearch adapter settings.They are listed in the order in which they appear in the system settings (Elasticsearch 6 entries in the search category).

Resolution

clusterName=LiferayElasticsearchCluster

String value that sets the name under which the cluster will be integrated.If the operation mode is set to remote, the names must match.(Reference:Remote Operation Mode)

operationMode=EMBEDDED

There are two operational modes: EMBEDDED and REMOTE.If you want to connect to an independent Elasticsearch cluster, configure it with REMOTE.If you want to start Liferay on an Elasticsearch instance in the internals, set it up with EMBEDDED.Embedded mode is not supported in production environments.

indexNamePrefix=liferay-

Set a String value as Prefix for the search index name.Normally, changing the default values is not recommended.If you have made changes, rebuildall indexes in the portaland manually delete the previous indexes from the Elasticsearch management console.

indexNumberOfReplicas=Sets the number of replicas for each index. If not set, replicas are not used. A re-index is required for the changes to take effect.

indexNumberOfShards= Sets the number of index shards to use when creating a Liferay index. If not set, a single shard is used. A re-index is required for the changes to take effect.

bootstrapMlockAll=false

If this boolean setting is true, it reserves process address space space in RAM and suppresses Elasticsearch memory swapping (see herefor details).

logExceptionsOnly=true

If this boolean setting is true, only exceptions from Elasticsearch are logged and do not generate exceptions again.

retryOnConflict=5

Set an integer value for the number of retries when a change occurs between the time the document is retrieved and the time of the update and a version mismatch occurs.(For more information, visit here)

discoveryZenPingUnicastHostsPort=9300-9400

Sets the String value for the port range to be used when creating the value for discovery.zen.ping.unicast.hosts.Multiple Elasticsearch nodes in the same port range act as gossip routers on the same computer.(For more information, visit here)

networkHost=

Set the String value that instructs the node to bind to a hostname or IP address and expose this host to other nodes in the cluster.This is a shortcut to set the bind host and the public host at the same time.

(For more information, visit here)

networkBindHost=

Sets the String value of the network interface that will receive the request to bind the node.(For more information, visit here)

networkPublishHost=

Sets the String value of a single interface that informs other nodes in the cluster so that nodes can connect to each other.(For more information, visit here)

transportTcpPort=

Set this String value to bind the ports for communication between nodes.A single port number or a range of port numbers can be specified.(For more information, visit here)

transportAddresses=localhost:9300

String value that sets the address to which the remote Elasticsearch node will connect.This value is required when the operation mode is set to remote.(For more information, see here) You can set up nodes as needed.

clientTransportSniff=true

Enable cluster sniff and set this boolean setting to true to dynamically find data nodes in the cluster.(For more information, visit here)

clientTransportIgnoreClusterName=false

Set this boolean setting to true to disable cluster name authentication for connected nodes.(For more information, visit here)

clientTransportPingTimeout= Time in seconds that the client node waits for a ping response from the node. If not set, Elasticsearch default valueclient.transport.ping_timeoutis used.

clientTransportNodesSamplerInterval=

String value that sets the frequency of sample/ping for the listed and connected nodes to the client node.(For more information, visit here)

httpEnabled=true

By setting this value to false, all nodes will not receive http requests.With this setting, all nodes will not receive REST requests directly.

This setting has been deprecated inElasticsearch 6.3 and will be deprecated in, as well as the corresponding setting in the connector. Since this setting was only used for the built-in Elasticsearch server configuration, its elimination will have minimal impact on the production environment.

httpCORSEnabled=true

To disable cross-origin resource sharing, set this boolean setting to false.(e.g.:whether another browser can make requests to Elasticsearch) If disabled, web front tools such as elasticsearch-head cannot connect.(For more information, visithere)

httpCORSAllowOrigin=/https?:\\/\\/localhost(:[0-9]+)?/

Sets the origin of the String value when HTTP CORS is enabled.(For more information, visit here)

httpCORSConfigurations=

String value for HTTP CORS custom settings in YML format (elasticsearch.yml).(For more information, please visit here)

additionalConfigurations=

String values for built-in Elasticsearch custom settings in YML format.

Reference: Adding a Configuration to the Liferay Elasticsearch Adapter

additionalIndexConfigurations=

String values for custom Liferay index settings in JSON or YML format.

Reference: Adding a setting to the Liferay Elasticsearch adapter

additionalTypeMappings=

Set up a custom mapping for the String value of LiferayDocumentType in JSON format (see the documentation for setting up the Elasticsearch Mapping API).

overrideTypeMappings=

Overrides the default type mapping for Liferay DXP.This is an advanced feature and should only be used when strictly necessary.

If this value is set, the default mappings used to define Liferay document types in the Liferay DXP source code (e.g.:liferay-type-mappings.json) are completely ignored, so not only the segment to change, but also the mapping The entire definition is included in this property.

syncSearch=trueIf enabled, the search will be performed in the calling thread, not in the Elasticsearch search thread pool.

Settings that affect only the built-in Elasticsearch Server

These settings (defined above) are intended to be used only when configuring the embedded Elasticsearch server. These settings do not affect remote Elasticsearch installations.

  • bootstrapMlockAll
  • discoveryZenPingUnicastHostsPort
  • networkHost
  • networkBindHost
  • networkPublishHost
  • transportTcpPort
  • httpEnabled
  • httpCORSEnabled
  • httpCORSAllowOrigin
  • httpCORSConfigurations
  • syncSearch

These settings are easily configured in the System Settings application.It can also be specified in the deployable OSGi .config file, as described above.

Did this article resolve your issue ?

Legacy Knowledge Base