From 5b4e4bb8583625f409e62f6c194947970a6a8082 Mon Sep 17 00:00:00 2001 From: John Braun Date: Fri, 8 Oct 2021 15:07:15 +0200 Subject: [PATCH] Highlight numbers (int) as string in formatted JSON --- meilisearch-lib/src/index/search.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meilisearch-lib/src/index/search.rs b/meilisearch-lib/src/index/search.rs index a0ea26127..25771a5d4 100644 --- a/meilisearch-lib/src/index/search.rs +++ b/meilisearch-lib/src/index/search.rs @@ -555,6 +555,10 @@ impl<'a, A: AsRef<[u8]>> Formatter<'a, A> { }) .collect(), ), + Value::Number(number) => { + let number_string_value = self.format_string(number.to_string(), matcher, format_options); + Value::String(number_string_value) + } value => value, } }