首页 > 解决方案 > 如何向 Magento2 ajax 搜索建议请求添加更多参数?

问题描述

我想添加修改搜索请求 (search/ajax/suggest/?q) 参数以包括以下内容:

"query": {
    "multi_match": {
      "query": "rad",
      "fields": ["name^4", "sku"],
      "type": "most_fields",
      "operator": "and",
      "minimum_should_match": 3,
      "tie_breaker": 0.0,
      "analyzer": "standard",
      "boost": 1,
      "fuzziness": "AUTO",
      "fuzzy_transpositions": true,
      "lenient": false,
      "prefix_length": 0,
      "max_expansions": 50,
      "auto_generate_synonyms_phrase_query": true,
      "cutoff_frequency": 0.01,
      "zero_terms_query": "none"
    }
  }

我使用 AWS opensearch 作为我的搜索引擎。Magento 2.4.3 版

标签: magento2

解决方案


推荐阅读