匹配查询:
{
"query":{
"bool":{
"should":[
{
"match":{
"nAME":{
"analyzer":"my_fuzzy_analyzer",
"fuzziness":"AUTO:1,4",
"fuzzy_transpositions":true,
"max_expansions":2147483647,
"minimum_should_match":-1,
"operator":"and",
"prefix_length":3,
"query":"SHENZHEN LONGTANUO LOGISTICS C "
}
}
}
]
}
}
}
`
预期成果:
注:国际-有限公司-物流停止,
但只得到了结果:深圳龙头物流C
我不明白为什么。因为每个文本都有-1匹配
分析器:`
{
"atlas.zcustomer":{
"settings":{
"index":{
"number_of_shards":"5",
"provided_name":"atlas.zcustomer",
"creation_date":"1563288936515",
"analysis":{
"filter":{
"my_stop_word":{
"type":"stop",
"stopwords":[
"ith",
"ihr",
"san",
"tic",
"ltd",
"de",
"la",
"s",
"a",
"inc",
"logistics",
"international"
]
},
"my_length":{
"type":"length",
"min":"3"
}
},
"analyzer":{
"my_fuzzy_analyzer":{
"filter":[
"my_length",
"lowercase",
"my_stop_word"
],
"type":"custom",
"tokenizer":"standard"
}
}
},
"number_of_replicas":"1",
"uuid":"KVI55mDhS4mtumpOqp4mjw",
"version":{
"created":"6060099"
}
}
}
}
}
`
发布于 2019-07-16 18:07:27
所需匹配的数量相对于查询中的术语数。在您的示例中,您有3个术语(使用标准令牌器和秒针):
因此,至少有两个条件必须匹配。在您的示例中,只有一个术语匹配,因为LOGISTICS
在终止词中。我希望这对你来说更清楚。
https://stackoverflow.com/questions/57062804
复制相似问题