Installing a Search Engine
A search engine is a critical component of your Liferay installation. Creating an Example Cluster can get you started with the installation, but this guide demonstrates setting up a production environment.
When you start Liferay, a bundled Elasticsearch server (sidecar) starts simultaneously. This default search engine provides search capabilities as a convenience for testing, but it isn’t supported for use in production. Getting Started with Elasticsearch describes production-level Elasticsearch setup. Using the Sidecar or Embedded Elasticsearch describes the default Elasticsearch server (sidecar in 7.3+ and embedded in 7.2) features and limitations.
Java Requirements
-
Search engines require the environment variable
JAVA_HOME
orES_JAVA_HOME
(Elasticsearch 8). Set it on your search engine host. -
If you’re using Liferay 7.2, Elasticsearch and Liferay must use the same Java version and distribution. Consult the Elasticsearch compatibility matrix and Liferay’s Search Engine Compatibility Matrix to learn more about supported JDK distributions and versions. You can specify this in Elasticsearch:
[Elasticsearch Home]/bin/elasticsearch.in.sh`: `JAVA_HOME=/path/to/java`
The Java version and distribution requirement doesn’t apply to Liferay 7.3+ because the Elasticsearch 7 connector communicates via HTTP; there’s no JVM level serialization. See Elastic’s High-Level REST Client documentation for details.
The same requirement doesn’t apply to Solr either because the Solr connector also communicates via HTTP.
Clustering the Search Engine
A production environment’s search engine should be clustered for load management and optimal performance. Elasticsearch, OpenSearch, and Solr can be configured on multiple nodes in the remote environment.
-
To configure a remote Elasticsearch server or cluster, see Getting Started with Elasticsearch.
-
To configure a remote Solr server or cluster, see Installing Solr.
Selecting a Search Engine: Feature Comparison
Elasticsearch is the recommended search engine for search and indexing with Liferay, and its connector is installed out-of-the-box. Connectors for OpenSearch and Solr are available in the Liferay Marketplace, but beware of the feature limitations (see below). Solr is planned for deprecation.
Always choose the latest compatible search engine version. Refer to the Search Engine Compatibility Matrix to find the exact versions supported.
Liferay Feature | Elasticsearch | OpenSearch | Solr |
---|---|---|---|
Secure connection (encryption and authentication) | ✔ | ✔ | ✔ |
Objects | ✔ | ✔ | ✘ |
Commerce | ✔ | ✔ | ✘ |
Content Dashboard | ✔ | ✔ | ✘ |
Workflow Metrics | ✔ | ✔ | ✘ |
Custom Filter widget | ✔ | ✔ | ✘ |
Low Level Options widget | ✔ | ✔ | ✘ |
Similar Results | ✔ | ✔ | ✘ |
Result Rankings | ✔ | ✔ | ✘ |
Synonyms | ✔ | ✔ | ✘ |
High availability reindexing (concurrent and sync reindex modes) | ✔ | ✔ | ✘ |
Search Blueprints | ✔ | ✔ | ✘ |
Semantic Search | ✔ | ✔ | ✘ |
Learning to Rank | ✔ | ✘ | ✘ |
Elasticsearch Monitoring (Kibana integration) | ✔ | ✘ | ✘ |
Cross-Cluster Replication | ✔ | ✘ | ✘ |
Solr has additional limitations. See Solr Limitations for more information.
What’s Next
Installing Elasticsearch is recommended. If you must use Solr (deprecated), see Installing Solr.