Configuring Search
Liferay uses Elasticsearch to search and index content. In a Liferay cluster, Elasticsearch must be installed on a separate server accessible by each node. Follow the steps below to configure Elasticsearch. See Getting Started with Elasticsearch to learn more.
Running Elasticsearch
-
Create a local folder for storing Elasticsearch’s data volume. For example,
mkdir -p [your_folder]/elasticsearch/es_data_volume
-
Start a new Elasticsearch container.
docker run -it \ -e cluster.name=LiferayElasticsearchCluster \ -e ES_JAVA_OPTS="-Xms512m -Xmx512m" \ --name elasticsearch \ -p 9200:9200 \ -p 9300:9300 \ -v $(pwd)/elasticsearch/es_data_volume:/usr/share/elasticsearch/data \ elasticsearch:8.6.2
-
Install Elasticsearch plugins.
docker exec -it elasticsearch bash -c '/usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu && /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-kuromoji && /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-smartcn && /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-stempel'
The next step is configuring the DXP cluster.