Legacy Knowledge Base
Published Jun. 30, 2025

Re-indexing is not working properly

Written By

Anushka Tiwari

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.

Issue

  • When performing the full re-indexing the following error appears in the logs
org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; 
nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default.
Please use a keyword field instead. Alternatively, set fielddata=true on [entryClassPK] in order to load field data by uninverting the inverted index.Note that this can use significant memory.]];
nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default.
Please use a keyword field instead. Alternatively, set fielddata=true on [entryClassPK] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]];

Environment

  • Liferay DXP 7.4

Resolution

  • After clicking on the full re-index, the procedure is that it first deletes the indexes and then leaves a small gap of time, and then third creates an index with Liferay mappings applied.
  • Exceptions like the above usually appear when Liferay’s mappings are not applied properly. In the small gap of time of the re-indexing, if a document is uploaded, modified, and then sent to the index before the index exists, the index is automatically created with default elastic mappings applied, which are not compatible with the defaults that the portal uses if it creates the index.
  • The solution is to perform a full reindex after:
    • Option 1) Update elasticsearch.yml to disable auto_create_index for liferay indexes:
    • # With Liferay versions prior to DXP 2024.Q2/Portal GA120, uncomment to disable
      # index auto-creation for indexes prefixed with 'liferay-'
      action.auto_create_index:"-liferay-*
    • Option 2) Alternatively, you could use elasticSearch API to update this configuration:
    • PUT _cluster/settings { "persistent": { "action.auto_create_index": "-liferay-*,*" } }
  • Although the issue is fixed after 2024.Q2/Portal GA120 , this issue can be still reproduced if the Liferay Connector user does not permission to update this setting.
  • Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base