Legacy Knowledge Base
Published Jul. 2, 2025

Field data is disabled on text fields by default

Written By

Pooja Bhambani

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

IllegalArgumentException is occurred when trying to run vanilla instance with commerce and search functionality is not working properly in Catalog Page.

  • Text fields are not optimised
    ERROR [http-nio-8080-exec-7][ElasticsearchIndexSearcher:165] java.lang.RuntimeException: 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 [basePrice] 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 [basePrice] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]];

Environment

  • Liferay DXP 7.3
  • Commerce 3.0

Resolution

Please Note: Please take the complete back up before performing the re-indexing and It may take a considerable amount of time depending on the data. so, please perform the re-indexing accordingly as per your discretion.

  • This error occurred, because in Commerce few mappings fields are changed in the elastic search mapping.
  • To resolve this, run a full reindex of all search indexes. 
  • Navigate to Control Panel -> Configuration -> Search -> Go to index actions and click execute button next "Reindex all search indexes" text. 
Did this article resolve your issue ?

Legacy Knowledge Base