Configuring Search

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

  1. Create a local folder for storing Elasticsearch’s data volume. For example,

    mkdir -p [your_folder]/elasticsearch/es_data_volume
  2. Start a new Elasticsearch container.

    docker run -it \
       -e \
       -e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
       --name elasticsearch \
       -p 9200:9200 \
       -p 9300:9300 \
       -v $(pwd)/elasticsearch/es_data_volume:/usr/share/elasticsearch/data \
  3. 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'

    Note, though not required, these provide additional search support for Unicode and other languages.

The next step is configuring the DXP cluster.

Relevant Concepts