常量分数查询
编辑常量分数查询
编辑封装一个 过滤查询,并为每个匹配的文档返回一个等于 boost
参数值的相关性评分。
resp = client.search( query={ "constant_score": { "filter": { "term": { "user.id": "kimchy" } }, "boost": 1.2 } }, ) print(resp)
response = client.search( body: { query: { constant_score: { filter: { term: { 'user.id' => 'kimchy' } }, boost: 1.2 } } } ) puts response
const response = await client.search({ query: { constant_score: { filter: { term: { "user.id": "kimchy", }, }, boost: 1.2, }, }, }); console.log(response);
GET /_search { "query": { "constant_score": { "filter": { "term": { "user.id": "kimchy" } }, "boost": 1.2 } } }