我用这2个查询Elasticsearch:宜+ minimum_should_match VS必须
查询与必须
{
"size": 200,
"from": 0,
"query": {
"bool": {
"must": [ {
"match": {
"_all": "science"
}
},
{
"match": {
"category": "fiction"
}
},
{
"match": {
"country": "us"
}
}
]
}
}
}
查询与宜+ minimum_required_match
{
"size": 200,
"from": 0,
"query": {
"bool": {
"should": [ {
"match": {
"_all": "science"
}
},
{
"match": {
"category": "fiction"
}
},
{
"match": {
"country": "us"
}
}
],
minimum_required_match: 3
}
}
}
两个查询给测试我同样的结果,我不知道这两个之间的区别,当我们sh应该使用minimum_required_match?
有没有'minimum_required_match'参数,你的意思' minimum_should_match'? – Val
是的,这是最低限度_should_match,我的坏〜 – plchia