elasticsearch - Elasticsearch fuzziness and multiple terms comparison
问题描述
Basically im currently creating fuzzy search for elasticsearch and i have two kinds of search to compare
One is auto fuzzy search
{
"query": {
"match": {
"user": {
"query": "test",
"fuzziness": "AUTO"
}
}
}
}
Others is a terms query matching with multiple typos
{
"query" : {
"terms" : {
"user" : ["test", "testt", "tesr", "tst", ...]
}
}
}
assuming thre might be around 20s or more of the terms, what i want to know is, which one is more likely a better practice and better by performance, and how scalable is terms matching with a lot of keyword.
解决方案
匹配查询:
- 分析输入字符串并从中构造更多基本查询。
- 当您需要全文搜索功能时使用它。
- 您可以将其用于部分匹配、令牌搜索、模糊逻辑
术语查询:
- 匹配确切的术语。
- 如果搜索的文本不需要任何分析,即必须按原样匹配文本,则应使用此选项。
- 它比匹配更快
推荐阅读
- html - 如何保存和使用来自输入类型收音机的数据
- java - 用于 ValueObject 层次结构的 Jackson 序列化器 - 多态
- python - 如何使用 fpdf 将表格添加到 pdf 页面中
- ubuntu - ssh 更改默认身份验证
- git - 带有壁球的 Git Workflow 短期功能分支
- python - python中的语音识别在linux中不起作用
- javascript - 如何将子组件数据传递给父组件
- javascript - WooCommerce 在使用浏览器后退按钮和页面刷新后将产品变体列表重置为第一个?
- swift - 在 Swift 5 上使用 GeoFire 4 (Firebase 7) 在您的区域中获取所有用户
- python - 将熊猫数据框的输出保存到文件