【发布时间】:2021-01-12 11:18:58
【问题描述】:
如果我搜索“thank”,我想知道如何返回“thanks”或“thanking” 目前我有一个多重匹配查询,它只返回出现的“谢谢”,比如“谢谢”,而不是“感恩节”或“谢谢”。我正在使用 ElasticSearch 7.9.1
query: {
bool: {
must: [
{match: {accountId}},
{
multi_match: {
query: "thank",
type: "most_fields",
fields: ["text", "address", "description", "notes", "name"],
}
}
],
filter: {match: {type: "personaldetails"}}
}
},
还可以将多重匹配查询与其中一个字段上的 queryString 结合起来(比如描述,我只会在描述上进行查询字符串搜索,在其他字段上进行短语匹配)
{ "query": {
"query_string": {
"query": "(new york city) OR (big apple)",
"default_field": "content"
}
}
}
感谢任何输入。 谢谢
【问题讨论】:
标签: elasticsearch search