mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
Merge #3890
3890: Fix the analytics of the sort facet values by count feature r=dureuill a=Kerollmops This PR ensures we return the right analytics from the settings route. Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
commit
b422e5fdc3
@ -5,6 +5,7 @@ use index_scheduler::IndexScheduler;
|
|||||||
use log::debug;
|
use log::debug;
|
||||||
use meilisearch_types::deserr::DeserrJsonError;
|
use meilisearch_types::deserr::DeserrJsonError;
|
||||||
use meilisearch_types::error::ResponseError;
|
use meilisearch_types::error::ResponseError;
|
||||||
|
use meilisearch_types::facet_values_sort::FacetValuesSort;
|
||||||
use meilisearch_types::index_uid::IndexUid;
|
use meilisearch_types::index_uid::IndexUid;
|
||||||
use meilisearch_types::settings::{settings, RankingRuleView, Settings, Unchecked};
|
use meilisearch_types::settings::{settings, RankingRuleView, Settings, Unchecked};
|
||||||
use meilisearch_types::tasks::KindWithContent;
|
use meilisearch_types::tasks::KindWithContent;
|
||||||
@ -550,10 +551,16 @@ pub async fn update_all(
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.set()
|
.set()
|
||||||
.and_then(|s| s.max_values_per_facet.as_ref().set()),
|
.and_then(|s| s.max_values_per_facet.as_ref().set()),
|
||||||
"sort_facet_values_by": new_settings.faceting
|
"sort_facet_values_by_star_count": new_settings.faceting
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.set()
|
.set()
|
||||||
.and_then(|s| s.sort_facet_values_by.as_ref().set()),
|
.and_then(|s| {
|
||||||
|
s.sort_facet_values_by.as_ref().set().map(|s| s.iter().any(|(k, v)| k == "*" && v == &FacetValuesSort::Count))
|
||||||
|
}),
|
||||||
|
"sort_facet_values_by_total": new_settings.faceting
|
||||||
|
.as_ref()
|
||||||
|
.set()
|
||||||
|
.and_then(|s| s.sort_facet_values_by.as_ref().set().map(|s| s.len())),
|
||||||
},
|
},
|
||||||
"pagination": {
|
"pagination": {
|
||||||
"max_total_hits": new_settings.pagination
|
"max_total_hits": new_settings.pagination
|
||||||
|
Loading…
Reference in New Issue
Block a user