mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 13:10:06 +01:00
return the order in the score details
This commit is contained in:
parent
7b9e0d2944
commit
d8fe4fe49d
@ -869,7 +869,9 @@ async fn test_degraded_score_details() {
|
|||||||
],
|
],
|
||||||
"cattos": "pésti",
|
"cattos": "pésti",
|
||||||
"_rankingScoreDetails": {
|
"_rankingScoreDetails": {
|
||||||
"skipped": 0.0
|
"skipped": {
|
||||||
|
"order": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -883,7 +885,9 @@ async fn test_degraded_score_details() {
|
|||||||
"pestiféré"
|
"pestiféré"
|
||||||
],
|
],
|
||||||
"_rankingScoreDetails": {
|
"_rankingScoreDetails": {
|
||||||
"skipped": 0.0
|
"skipped": {
|
||||||
|
"order": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -900,7 +904,9 @@ async fn test_degraded_score_details() {
|
|||||||
"gomez"
|
"gomez"
|
||||||
],
|
],
|
||||||
"_rankingScoreDetails": {
|
"_rankingScoreDetails": {
|
||||||
"skipped": 0.0
|
"skipped": {
|
||||||
|
"order": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -101,7 +101,7 @@ impl ScoreDetails {
|
|||||||
ScoreDetails::Vector(vector) => RankOrValue::Score(
|
ScoreDetails::Vector(vector) => RankOrValue::Score(
|
||||||
vector.value_similarity.as_ref().map(|(_, s)| *s as f64).unwrap_or(0.0f64),
|
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;
|
order += 1;
|
||||||
}
|
}
|
||||||
ScoreDetails::Skipped => {
|
ScoreDetails::Skipped => {
|
||||||
details_map.insert(
|
details_map
|
||||||
"skipped".to_string(),
|
.insert("skipped".to_string(), serde_json::json!({ "order": order }));
|
||||||
serde_json::Number::from_f64(0.).unwrap().into(),
|
|
||||||
);
|
|
||||||
order += 1;
|
order += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user