简体   繁体   English

带有 ascii 折叠的 Reactivesearch Autosuggest

[英]Reactivesearch Autosuggest with ascii-folding

I do not seem to be able to get autosuggest to work with ascii folding (ie convert accents to their ascii equivalents)我似乎无法让 autosuggest 使用 ascii 折叠(即将重音转换为其 ascii 等效项)

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

Mapping映射

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

Thank you @David for reporting this.感谢@David 报告此事。

Can you try adding ascii fields to dataField prop.您可以尝试将 ascii 字段添加到dataField吗? dataField prop can accept either String or Array, so you can specify multiple fields there, example dataField属性可以接受字符串或数组,因此您可以在那里指定多个字段,例如

<DataSearch
   dataField={["_name", "_name.ascii", ...othersIfAny]}
   ...
/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM