浏览文章
文章信息
Magento2 Sorting not working with elasticsearch7 | 解决elasticsearch排序不工作问题
12981
日志报错:
[2021 - 08 - 24 01: 35: 49] main.CRITICAL: { "error": { "root_cause": [{ "type": "query_shard_exception", "reason": "No mapping found for [top_rated] in order to sort on", "index_uuid": "03ag21QnSVKtfxvvFBkXWQ", "index": "dev_nicepairs_product_1_v16" }], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [{ "shard": 0, "index": "dev_nicepairs_product_1_v16", "node": "4tWe-9IFSOSSbvQAXiRG_g", "reason": { "type": "query_shard_exception", "reason": "No mapping found for [top_rated] in order to sort on", "index_uuid": "03ag21QnSVKtfxvvFBkXWQ", "index": "dev_nicepairs_product_1_v16" } }] }, "status": 400 } { "exception": "[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [top_rated] in order to sort on\",\"index_uuid\":\"03ag21QnSVKtfxvvFBkXWQ\",\"index\":\"dev_nicepairs_product_1_v16\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"dev_nicepairs_product_1_v16\",\"node\":\"4tWe-9IFSOSSbvQAXiRG_g\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [top_rated] in order to sort on\",\"index_uuid\":\"03ag21QnSVKtfxvvFBkXWQ\",\"index\":\"dev_nicepairs_product_1_v16\"}}]},\"status\":400} at /www/wwwroot/nicepairs.com/www.nicepairs.com/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:675)" }[]原因:搜索索引未更新
解决:项目下运行搜索索引更新
bin/magento indexer:reindex catalogsearch_fulltext