有没有办法在弹性搜索的布尔查询中将最低分数应用于必须子句。
我希望能够做这样的事情:
{
"query": {
"bool": {
"must": [
{
"match": {
"name": {
"query":"A Name",
"min_score": 0.3
}
}
},
{
"match": {
"address": {
"query":"1 Somewhere Street, Somewhereset, UK",
"min_score": 0.3
}
}
}
]
}
}
}
这将要求名称查询与分数 > 0.3 匹配,地址查询与分数 > 0.3 匹配,才能返回文档。这是为了阻止返回非常好的名称匹配,尽管地址匹配很糟糕(例如,仅匹配 1),反之亦然。
我目前正在使用 Elasticsearch 1.5,但我过去也希望在 2.3 中使用它。