我正在尝试在提升查询中进行bool查询,但无法获得所需的结果
qry = {
"query" : {
"boosting" : {
"positive" : {
"bool" : {
"must" : [
{
"match" : {
"author" : "doyle"
}
},
{
"match" : {
"text" : "elementary"
}
}
]
}
},
"negative" :{
"match" : {
"text" : "holmes"
}
},
"negative_boost" : 0.2
}
}
}
提升查询的否定部分似乎并不适用于具有' holmes'不被压制。
以下是索引
的映射mapping = {
"mappings" : {
"book" : {
"properties" : {
"title" : {
"type" : "text",
"index_options" : "docs"
},
"author" : {
"type" : "text",
"index_options" : "docs"
},
"line_no" : {
"type" : "integer"
},
"text" : {
"type" : "text",
"index_options" : "offsets"
}
}
}
}
}