0
我使用從searchkit 2.2.0 搜索盒並想使多匹配查詢與選項型best_fields到elasticsearch。搜索盒多匹配查詢類型best_fields和NOT phrase_prefix
- 如何設置型best_fields當我使用prefixQueryFields?
- 如何正確設置prefixQueryOptions對象類型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"]}/>
![result query: prefixQueryFields and type phrase_prefix](https://i.stack.imgur.com/lK3KK.png)
如果我設置prefixQueryOptions屬性,避免類型phrase_prefix,查詢變得只是simple_query_string。也許我在這裏犯了一個錯誤,當我設置prefixQueryOptions對象。
<SearchBox autofocus={true} searchOnChange={true} prefixQueryOptions={{
\t \t \t \t "fields" : [ "fileName^3", "path", "attachment.content", "attachment.author", "attachment.title" ],
\t \t \t \t "type": "best_fields"
\t \t \t }}/>
![result query: prefixQueryOptions and simple_query_string](https://i.stack.imgur.com/Zy3VL.png)