我的用例是在一个基于模糊和前缀匹配的字段中突出显示多个短语/单词。为此,我目前使用span_near来处理短语,使用span_multi来允许在短语术语中使用模糊性。我还需要使用prefix_length,以便只允许前缀匹配后的字符使用模糊,但span_multi不允许多个多项查询。有没有其他方法可以做到这一点?
"query":{
"bool":{
"should":[{
"span_near": {
"clauses": [
{
"span_multi": {
"match": {
"fuzzy": {
"comment": {
"fuzziness": "5",
"value": "Beata"
}
}
}
}
},
{
"span_multi": {
"match": {
"fuzzy": {
"comment": {
"fuzziness": "5",
"value": "Rosenane"
}
}
}
}
}
],
"in_order": False,
}},{
"span_near": {
"clauses": [
{
"span_multi": {
"match": {
"fuzzy": {
"comment": {
"fuzziness": "5",
"value": "Christna"
}
}
}
}
}
],
"in_order": False,
}}]
}
},
"highlight" : {
"fields" : {
"comment" : { "pre_tags" : ["<temp>"], "post_tags" : ["</temp>"],
"number_of_fragments" : 0
}
}
}
}发布于 2020-11-05 02:00:38
嘿,所以它是工作在
"comment": {
"fuzziness": "5",
"value": "Rosenane",
"prefix_match":3
}https://stackoverflow.com/questions/64589374
复制相似问题