我的用例是在基于模糊和前缀匹配检索的字段中突出显示多个短语/单词。为此,我目前使用span\u near来处理短语,span\u multi允许在短语术语中使用模糊性。我还需要使用前缀长度,这样模糊只允许前缀匹配后的字符,但span\u 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
}
}
}
}
1条答案
按热度按时间tjrkku2a1#
嘿,原来是和