From f35ad96afac62460f451963fdc5ab84e0da23b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 27 Apr 2023 17:01:18 +0200 Subject: [PATCH] Use the disableOnAttributes parameter on the facet-search route --- milli/src/search/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index 2b02b1bf8..97efb94a1 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -293,7 +293,11 @@ impl<'a> SearchForFacetValues<'a> { match self.query.as_ref() { Some(query) => { - if self.search_query.index.authorize_typos(rtxn)? { + let authorize_typos = self.search_query.index.authorize_typos(rtxn)?; + let field_authorizes_typos = + !self.search_query.index.exact_attributes_ids(rtxn)?.contains(&fid); + + if authorize_typos && field_authorizes_typos { let mut result = vec![]; let exact_words_fst = self.search_query.index.exact_words(rtxn)?;