当我尝试查询突出显示时,我面临非常尴尬的结果 搜索弹性搜索2.4。我查询一个包含连字符(' - ')的术语,例如与药物有关,我得到一个结果集,响应一般都是正确的,但是一些结果的片段就像
结果:
1)药物滥用的其他费用包括与药物有关的死亡,可卡因,裂缝和甲基苯丙胺。
2)与毒品有关的犯罪,与毒品有关的财富,Escobar资助私人军队进行,
3)在无意中被驱逐到药物的中间
4)在国际机场的贩运者之间相关的枪战
问题:文本(与药物有关)已分为2个片段(3& 4)。 预期:与药物有关的应该是单一的。
这是我的查询
{"size" : 5000,
"query" : {
"bool" : {
"must" : [ {
"match" : {
"bookId" : {
"query" : "<SomeID>",
"type" : "boolean",
"operator" : "AND"
}
}
}, {
"match" : {
"contentType" : {
"query" : "booktext",
"type" : "boolean",
"operator" : "AND"
}
}
}, {
"bool" : {
"must" : {
"match" : {
"content" : {
"query" : "drug-related*",
"type" : "phrase_prefix"
}
}
}
}
} ]
}
},
"highlight" : {
"pre_tags" : [ "" ],
"post_tags" : [ "" ],
"fragment_size" : 60,
"number_of_fragments" : 5000,
"boundary_max_scan" : 10,
"highlight_query" : {
"bool" : {
"must" : [ {
"match" : {
"bookId" : {
"query" : "<BookID>",
"type" : "boolean",
"operator" : "AND"
}
}
}, {
"match" : {
"contentType" : {
"query" : "booktext",
"type" : "boolean",
"operator" : "AND"
}
}
}, {
"bool" : {
"must" : {
"match" : {
"content" : {
"query" : "drug-related*",
"type" : "phrase_prefix"
}
}
}
}
} ]
}
},
"fields" : {
"content" : { }
}
}
}
查询响应:**我无法在此处粘贴完整内容,但我正在添加响应点击
{content=[content], fragments[[ accurate figures available regarding the cost of drug-related prostitution, mentioned, other costs of drug abuse include drug-related deaths, cocaine, crack, and methamphetamines.
Drug-related crimes are, drug-related wealth, Escobar financed a private army to conduct, believed to be drug related. According to a news story on this, ,” the President wrote. “We have him.” (Bio. 2016)
Drug-related violence, in was inadvertently driven into the middle of a Drug, -related shootout between traffickers at the international airport]]}
我在这里看不到一个模式。有人可以解释一下原因吗?