## 搜索包含java,不包含spark(如果包含spark不会说不需要,而是降低评分)
GET customer/_search
{
"query": {
"boosting": {
"positive": {
"match": {
"introduce": "Java"
}
},
"negative": {
"match": {
"introduce": "spark"
}
},
"negative_boost": 0.2
}
}
}
## 没有评分
GET customer/_search
{
"query": {
"bool": {
"should": [
{
"constant_score": {
"filter": {
"match": {
"introduce": "java"
}
}
}
},
{
"constant_score": {
"filter": {
"match": {
"introduce": "spark"
}
}
}
}
]
}
}
}
ES7.16.2基础操作-评分优化(九)
关注
打赏