From 3a8051866afc97af32575806a40adf8c3b9638a0 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 18 Nov 2024 11:12:36 +0100 Subject: [PATCH] Use `return_keyword_results` function instead of returning raw keyword results when the embedder is broken --- crates/milli/src/search/hybrid.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/milli/src/search/hybrid.rs b/crates/milli/src/search/hybrid.rs index 8b274804c..90833dfe9 100644 --- a/crates/milli/src/search/hybrid.rs +++ b/crates/milli/src/search/hybrid.rs @@ -205,7 +205,11 @@ impl<'a> Search<'a> { Ok(embedding) => embedding, Err(error) => { tracing::error!(error=%error, "Embedding failed"); - return Ok((keyword_results, Some(0))); + return Ok(return_keyword_results( + self.limit, + self.offset, + keyword_results, + )); } } }