我有以下查询为我的搜索添加模糊性.但是,我现在意识到匹配查询不考虑搜索字符串中单词的顺序,就像match_phrase那样.但是,我不能得到match_phrase给我模糊的结果.有没有办法告诉匹配考虑单词之间的顺序和距离?
{
"query": {
"match": {
"content": {
"query": "some search terms like this",
"fuzziness": 1,
"operator": "and"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
eco*_*eer 15
最终我发现我需要使用一组span查询,这些查询可以对模糊和污点进行大量的微调.我需要添加一个函数来手动标记我的短语并以编程方式添加到"子句"数组:
{"query":
{
"span_near": {
"clauses": [
{
"span_multi": {
"match": {
"fuzzy": {
"content": {
"fuzziness": "2",
"value": "word"
}
}
}
}
},
{
"span_multi": {
"match": {
"fuzzy": {
"content": {
"fuzziness": "2",
"value": "another"
}
}
}
}
}
],
"slop": 1,
"in_order": "true"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3754 次 |
| 最近记录: |