Legacy Knowledge Base
Published Jun. 30, 2025

Liferay Server Starts Up With org.elasticsearch.action.search.SearchPhaseExecutionException

Written By

Laura Li

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 Liferay starts up, we observes the following error:
    ERROR [liferay/schedulerdispatch-5][ElasticsearchIndexSearcher:169] java.lang.RuntimeException: 
    org.elasticsearch.action.search.SearchPhaseExecutionException: 
    Failed to execute phase [query], all shards failed; shardFailures {[uLTKGY0yQGOhY7um23rIOw][liferay-20101][0]: 
    RemoteTransportException[[node-1][10.241.20.11:9300][indices:data/read/search[phase/query]]]; nested: 
    IllegalArgumentException[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 [localizedtitleenUS_sortable] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]; }
    ......

 

Environment

  • Liferay DXP 7.2

 

Resolution

  • If your ES cluster do not serve other applications, you may add
    action.auto_create_index:false
    to elasticsearch.yml then do a full reindex.
  • Possible root cause: When someone executes a full reindex with deletes the index (and therefore the mappings) and then it recreates the index and then sets the mappings. In theory, between index creation and the put of the "catch all" dynamic template (which happens after index creation), a document was sent to elastic with these fields and the mapping was auto-created.

 

Additional Information

  • Please see Elastic's documentation about this setting.
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-management-settings.html

 

Did this article resolve your issue ?

Legacy Knowledge Base