mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
fix the sort position
This commit is contained in:
parent
31c7a0105b
commit
37ca50832c
@ -172,12 +172,12 @@ make_setting_route!(
|
|||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
analytics.publish(
|
analytics.publish(
|
||||||
"RankingRules Updated".to_string(),
|
"RankingRules Updated".to_string(),
|
||||||
json!({
|
json!({
|
||||||
"sort_position": setting.as_ref().map(|sort| sort.iter().filter(|s| s.contains(':')).count()),
|
"sort_position": setting.as_ref().map(|sort| sort.iter().position(|s| s == "sort")),
|
||||||
}),
|
}),
|
||||||
Some(req),
|
Some(req),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ pub async fn update_all(
|
|||||||
"Settings Updated".to_string(),
|
"Settings Updated".to_string(),
|
||||||
json!({
|
json!({
|
||||||
"ranking_rules": {
|
"ranking_rules": {
|
||||||
"sort_position": settings.ranking_rules.as_ref().set().map(|sort| sort.iter().filter(|s| s.contains(':')).count()),
|
"sort_position": settings.ranking_rules.as_ref().set().map(|sort| sort.iter().position(|s| s == "sort")),
|
||||||
},
|
},
|
||||||
"sortable_attributes": {
|
"sortable_attributes": {
|
||||||
"total": settings.sortable_attributes.as_ref().set().map(|sort| sort.len()),
|
"total": settings.sortable_attributes.as_ref().set().map(|sort| sort.len()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user