0

我似乎无法自动建议使用 ascii 折叠(即将重音转换为它们的 ascii 等价物)

  <DataSearch
      componentId="mainSearch"
      dataField="_name"
      categoryField="title"
      className="search-bar"
      queryFormat="and"
      placeholder="Search for movies..."
      iconPosition="left"
      autosuggest={true}
      filterLabel="search"
  />

映射

"_name": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "type": "keyword",
                        "ignore_above": 256
                    },
                    "ascii": {
                        "type": "text",
                        "analyzer": "autosuggest_analyzer"
                    },
                    "ascii2": {
                        "type": "text",
                        "analyzer": "ngram_analyzer"
                    }
                }
            },
4

1 回答 1

0

感谢@David 报告此事。

您可以尝试将 ascii 字段添加到dataFieldprop. dataFieldprop 可以接受字符串或数组,因此您可以在那里指定多个字段,例如

<DataSearch
   dataField={["_name", "_name.ascii", ...othersIfAny]}
   ...
/>
于 2019-12-04T07:24:20.800 回答