diff --git a/meilisearch/tests/search/mod.rs b/meilisearch/tests/search/mod.rs index 971539a31..88470187a 100644 --- a/meilisearch/tests/search/mod.rs +++ b/meilisearch/tests/search/mod.rs @@ -869,7 +869,9 @@ async fn test_degraded_score_details() { ], "cattos": "pésti", "_rankingScoreDetails": { - "skipped": 0.0 + "skipped": { + "order": 0 + } } }, { @@ -883,7 +885,9 @@ async fn test_degraded_score_details() { "pestiféré" ], "_rankingScoreDetails": { - "skipped": 0.0 + "skipped": { + "order": 0 + } } }, { @@ -900,7 +904,9 @@ async fn test_degraded_score_details() { "gomez" ], "_rankingScoreDetails": { - "skipped": 0.0 + "skipped": { + "order": 0 + } } } ], diff --git a/milli/src/score_details.rs b/milli/src/score_details.rs index f2c6fb58a..08dfcdbb6 100644 --- a/milli/src/score_details.rs +++ b/milli/src/score_details.rs @@ -101,7 +101,7 @@ impl ScoreDetails { ScoreDetails::Vector(vector) => RankOrValue::Score( vector.value_similarity.as_ref().map(|(_, s)| *s as f64).unwrap_or(0.0f64), ), - ScoreDetails::Skipped => RankOrValue::Score(0.), + ScoreDetails::Skipped => RankOrValue::Rank(Rank { rank: 0, max_rank: 1 }), } } @@ -262,10 +262,8 @@ impl ScoreDetails { order += 1; } ScoreDetails::Skipped => { - details_map.insert( - "skipped".to_string(), - serde_json::Number::from_f64(0.).unwrap().into(), - ); + details_map + .insert("skipped".to_string(), serde_json::json!({ "order": order })); order += 1; } }