mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Add analytics when all facets are sorted by count and the number of modified ones
This commit is contained in:
parent
eed9176e0c
commit
1d8dfafd25
@ -401,13 +401,17 @@ make_setting_route!(
|
|||||||
analytics,
|
analytics,
|
||||||
|setting: &Option<meilisearch_types::settings::FacetingSettings>, req: &HttpRequest| {
|
|setting: &Option<meilisearch_types::settings::FacetingSettings>, req: &HttpRequest| {
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
use meilisearch_types::facet_values_sort::FacetValuesSort;
|
||||||
|
|
||||||
analytics.publish(
|
analytics.publish(
|
||||||
"Faceting Updated".to_string(),
|
"Faceting Updated".to_string(),
|
||||||
json!({
|
json!({
|
||||||
"faceting": {
|
"faceting": {
|
||||||
"max_values_per_facet": setting.as_ref().and_then(|s| s.max_values_per_facet.set()),
|
"max_values_per_facet": setting.as_ref().and_then(|s| s.max_values_per_facet.set()),
|
||||||
"sort_facet_values_by": setting.as_ref().and_then(|s| s.sort_facet_values_by.clone().set()),
|
"sort_facet_values_by_star_count": setting.as_ref().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": setting.as_ref().and_then(|s| s.sort_facet_values_by.as_ref().set().map(|s| s.len())),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
Some(req),
|
Some(req),
|
||||||
|
Loading…
Reference in New Issue
Block a user