問題
コマースでバニラ インスタンスを実行しようとすると、 IllegalArgumentException が発生し、カタログ ページで検索機能が正しく動作しません。
-
テキスト フィールドが最適化されていません
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
解決策
ご注意ください: 再インデックスを実行する前に、完全なバックアップを取得してください。データによっては、かなりの時間がかかる場合があります。 したがって、あなたの裁量に従って、それに応じて再インデックスを実行してください。
- このエラーが発生したのは、 Commerce ではエラスティック検索マッピングでいくつかのマッピング フィールドが変更されたためです。
- これを解決するには、すべての検索インデックスの完全な再インデックスを実行します。
- コントロール パネル -> 構成 -> 検索 -> に移動し、インデックス アクションに移動し、「すべての検索インデックスの再インデックス」テキストの横にある実行ボタンをクリックします。