Fix score details casing

This commit is contained in:
ManyTheFish 2023-07-25 15:49:33 +02:00
parent 2452ec55b4
commit 88559a2d54
2 changed files with 4 additions and 4 deletions

View File

@ -820,8 +820,8 @@ async fn experimental_feature_score_details() {
}, },
"attribute": { "attribute": {
"order": 3, "order": 3,
"attribute_ranking_order_score": 1.0, "attributeRankingOrderScore": 1.0,
"query_word_distance_score": 0.8095238095238095, "queryWordDistanceScore": 0.8095238095238095,
"score": 0.9365079365079364 "score": 0.9365079365079364
}, },
"exactness": { "exactness": {

View File

@ -84,7 +84,7 @@ impl ScoreDetails {
// For now, fid is a virtual rule always followed by the "position" rule // For now, fid is a virtual rule always followed by the "position" rule
let fid_details = serde_json::json!({ let fid_details = serde_json::json!({
"order": order, "order": order,
"attribute_ranking_order_score": fid.local_score(), "attributeRankingOrderScore": fid.local_score(),
}); });
details_map.insert("attribute".into(), fid_details); details_map.insert("attribute".into(), fid_details);
order += 1; order += 1;
@ -102,7 +102,7 @@ impl ScoreDetails {
}; };
attribute_details attribute_details
.insert("query_word_distance_score".into(), position.local_score().into()); .insert("queryWordDistanceScore".into(), position.local_score().into());
let score = Rank::global_score([fid_details, *position].iter().copied()); let score = Rank::global_score([fid_details, *position].iter().copied());
attribute_details.insert("score".into(), score.into()); attribute_details.insert("score".into(), score.into());