elasticsearch - Elasticsearch 查询这种特殊类型的错字:“bath mat”与“bathmat”
问题描述
当有人输入错误的单词“bathmat”时,我试图从 Elasticsearch 获取结果——正确的拼写是“bath mat”。换句话说,当有人输入了错误的单词“bathmat”时,我希望 Elasticsearch 返回结果,就好像输入了正确的单词“bath mat”一样。
这是我的查询:
GET localhost:9200/products/_search
{
"size": 10000,
"query": {
"bool": {
"minimum_should_match": 1,
"should": [
{
"match": {
"title": {
"query": "bathmat",
"fuzziness": "AUTO"
}
}
},
{
"match_phrase": {
"main_description": "bathmat"
}
}
],
"must": [
{
"nested": {
"path": "taxonomies",
"query": {
"bool": {
"should": [
{ "match": { "taxonomies.name": "bathmat" }}
]
}
}
}
}
]
}
}
}
有人可以指向相关的 Elasticsearch 文档/博客文章,或者在下面解释我如何创建一个 Elasticsearch 请求来获得我正在寻找的结果吗?
解决方案
推荐阅读
- javascript - 我们如何使用 Puppeteer 编写脚本/自动化 Electron 应用程序?
- angular6 - 带有角度 6 的 Dialogflow 我应该使用 api-ai-javascript 还是基本 url?
- ios - 如何在 iPhone X 上将 ARSCNView 适配到 SafeArea?
- c# - 如何拥有列表视图行的所有元素?
- asp.net - asp.net MVC Web API - 记录发送给用户的新承载令牌
- python - 使用 Python 请求在提示中单击 OK 按钮
- c# - 将 JSON 结构动态转换为数组
- android - 将哈希图存储在数组中,反之亦然
- tensorflow - 多个 Inception V3 训练模型的 GPU 问题
- jquery - 引导表中的动态字符串