From 18a2c13e4ec03983ade28d97032f6bf77ea6d7be Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 2 Sep 2024 14:04:24 +0200 Subject: [PATCH] add analytics --- meilisearch/src/routes/indexes/settings.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meilisearch/src/routes/indexes/settings.rs b/meilisearch/src/routes/indexes/settings.rs index e95a75f69..ceea17668 100644 --- a/meilisearch/src/routes/indexes/settings.rs +++ b/meilisearch/src/routes/indexes/settings.rs @@ -636,11 +636,19 @@ fn embedder_analytics( .any(|config| config.document_template.set().is_some()) }); + let document_template_max_bytes = setting.as_ref().and_then(|map| { + map.values() + .filter_map(|config| config.clone().set()) + .filter_map(|config| config.document_template_max_bytes.set()) + .max() + }); + json!( { "total": setting.as_ref().map(|s| s.len()), "sources": sources, "document_template_used": document_template_used, + "document_template_max_bytes": document_template_max_bytes } ) }