提升查询
编辑提升查询
编辑返回匹配 positive
查询的文档,同时降低也匹配 negative
查询的文档的相关性得分。
你可以使用 boosting
查询来降低某些文档的排名,而不会将它们从搜索结果中排除。
示例请求
编辑resp = client.search( query={ "boosting": { "positive": { "term": { "text": "apple" } }, "negative": { "term": { "text": "pie tart fruit crumble tree" } }, "negative_boost": 0.5 } }, ) print(resp)
response = client.search( body: { query: { boosting: { positive: { term: { text: 'apple' } }, negative: { term: { text: 'pie tart fruit crumble tree' } }, negative_boost: 0.5 } } } ) puts response
const response = await client.search({ query: { boosting: { positive: { term: { text: "apple", }, }, negative: { term: { text: "pie tart fruit crumble tree", }, }, negative_boost: 0.5, }, }, }); console.log(response);
GET /_search { "query": { "boosting": { "positive": { "term": { "text": "apple" } }, "negative": { "term": { "text": "pie tart fruit crumble tree" } }, "negative_boost": 0.5 } } }