From f9cc12ae0f99794982e359ed7674a539185c3391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 13 Nov 2020 18:33:51 +0100 Subject: [PATCH] Do not try to parse empty faceted strings --- src/update/index_documents/store.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/update/index_documents/store.rs b/src/update/index_documents/store.rs index 3182e2ccd..9c75f10fe 100644 --- a/src/update/index_documents/store.rs +++ b/src/update/index_documents/store.rs @@ -586,9 +586,11 @@ fn parse_facet_value(ftype: FacetType, value: &Value) -> anyhow::Result { + let string = string.trim(); + if string.is_empty() { return Ok(()) } match ftype { FacetType::String => { - let string = SmallString32::from(string.as_str()); + let string = SmallString32::from(string); Ok(output.push(String(string))) }, FacetType::Float => match string.parse() {