Я считаю, что параметр _score
должен возвращать текущий показатель релевантности документа, но в моей ситуации он всегда возвращает 1. Это может быть связано с использованием только пользовательских функций оценки?
Это мой JSON-запрос:
{
"query": {
"bool": {
"must": [
{
"nested": {
"path": "skills",
"score_mode": "sum",
"query": {
"function_score": {
"boost_mode": "replace",
"query": {
"match": {
"skills.ext_id": "1394"
}
},
"functions": [
{
"field_value_factor": {
"field": "skills.score",
"missing": 0
}
}
]
}
}
}
}
],
"should": [
{
"function_score": {
"boost_mode": "replace",
"query": {
"match_all": {}
},
"functions": [
{
"script_score": {
"script": {
"source": "_score"
}
}
}
]
}
}
]
}
}
}
И это объяснение из запроса:
{"value"=>116.0,
"description"=>"sum of:",
"details"=>
[{"value"=>115.0,
"description"=>"Score based on 1 child docs in range from 4574 to 4622, best match:",
"details"=>
[{"value"=>115.0,
"description"=>"sum of:",
"details"=>
[{"value"=>115.0,
"description"=>"min of:",
"details"=>
[{"value"=>115.0, "description"=>"field value function: none(doc['skills.score'].value?:0.0 * factor=1.0)", "details"=>[]},
{"value"=>3.4028235e+38, "description"=>"maxBoost", "details"=>[]}]},
{"value"=>0.0,
"description"=>"match on required clause, product of:",
"details"=>
[{"value"=>0.0, "description"=>"# clause", "details"=>[]},
{"value"=>1.0, "description"=>"_type:__skills", "details"=>[]}]}]}]},
{"value"=>1.0,
"description"=>"min of:",
"details"=>
[{"value"=>1.0,
"description"=>
"script score function, computed with script:\"Script{type=inline, lang='painless', idOrCode='_score', options={}, params={}}\"",
"details"=>[{"value"=>1.0, "description"=>"_score: ", "details"=>[{"value"=>1.0, "description"=>"*:*", "details"=>[]}]}]},
{"value"=>3.4028235e+38, "description"=>"maxBoost", "details"=>[]}]}]}