Return the right analytics

This commit is contained in:
Clément Renault 2023-07-05 17:27:51 +02:00
parent 377fe33aac
commit da39a7b29e
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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