带有折叠功能的Reactivesearch Autosuggest

时间:2019-12-02 20:35:48

标签: elasticsearch reactivesearch

我似乎无法自动建议使用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"
                    }
                }
            },

1 个答案:

答案 0 :(得分:0)

感谢@David举报。

您可以尝试将ascii字段添加到dataField属性中吗? dataField属性可以接受String或Array,因此您可以在其中指定多个字段,例如

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