【发布时间】:2017-10-11 10:08:38
【问题描述】:
我正在使用 searchkit 2.2.0 中的 SearchBox,并希望使用选项 type best_fields 将 Multi Match Query 设置为 elasticsearch。 p>
- 当我使用prefixQueryFields时如何设置type best_fields?
- 如何正确设置 prefixQueryOptions 对象 type best_fields?
如果我设置 prefixQueryFields 属性,查询是我想要的多匹配,但类型是phrase_prefix 会得到我不喜欢的结果。 QueryAccessor.ts->this.options.prefixQueryFields->type:"phrase_prefix"
<SearchBox autofocus={true} searchOnChange={true} prefixQueryFields={["fileName^3", "path", "attachment.content", "attachment.author", "attachment.title"]}/>
如果我设置 prefixQueryOptions 属性,以避免键入phrase_prefix,查询就变成了simple_query_string。当我设置 prefixQueryOptions 对象时,也许我在这里犯了一个错误。
<SearchBox autofocus={true} searchOnChange={true} prefixQueryOptions={{
"fields" : [ "fileName^3", "path", "attachment.content", "attachment.author", "attachment.title" ],
"type": "best_fields"
}}/>
【问题讨论】:
标签: reactjs elasticsearch searchkit