[英]can I implement partial search for search results in hits for searchbox of searchkit
I am working on searchkit and I am trying to get the results on partial search for search in searchbox,but the results are available when complete text is matched in database.Is there a way to implement this,I have tried queryOptions={{analyzer: "patrial", default_operator:"AND", allow_leading_wildcard: true, analyze_wildcard: true}} in my searchbox tag,but it gives error while searching. 我正在研究searchkit,正在尝试在searchbox中进行部分搜索以获取搜索结果,但是当数据库中的完整文本匹配时,结果才可用。是否有实现此方法的方法,我尝试使用queryOptions = {{analyzer :“ patrial”,default_operator:“ AND”,allow_leading_wildcard:true,analyzer_wildcard:true}} ,但是在搜索时却出现错误。 This is my code of searchbox:
这是我的搜索框代码:
** <SearchBox
translations={{"searchbox.placeholder":" "}}
autofocus={true}
searchOnChange={true}
// queryOptions=
{{default_operator:"AND"}}
queryOptions={{analyzer: "patrial",
default_operator:"AND", allow_leading_wildcard:
true, analyze_wildcard: true}}
/>**
Try to use the Custom Query in the queryBuilder
of the SearchBox
component as mentioned in: This answer 尝试在
SearchBox
组件的queryBuilder
中使用自定义查询,如以下所述: 此答案
const customQueryBuilder = (query, options) => {
return {
"multi_match": {
"query": query,
"fields" : [ "field1", "field2", "field3"]
}
}
}
<SearchBox queryBuilder={customQueryBuilder} autofocus={true} queryOptions={{analyzer:"autocomplete", searchOnChange={true} prefixQueryFields={["field1", "field2", "field3"]} />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.