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.