From 24e5f6f7a917ab5da6715b8a91295d877ecd5f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Mon, 3 Apr 2023 09:17:33 +0200 Subject: [PATCH] Don't remove phrases with "last" term matching strategy --- milli/src/search/new/query_term.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/milli/src/search/new/query_term.rs b/milli/src/search/new/query_term.rs index 1e9b2852c..f0c4c3921 100644 --- a/milli/src/search/new/query_term.rs +++ b/milli/src/search/new/query_term.rs @@ -891,6 +891,11 @@ pub fn make_ngram( number_of_typos_allowed: &impl Fn(&str) -> u8, ) -> Result> { assert!(!terms.is_empty()); + for t in terms { + if ctx.term_interner.get(t.value).zero_typo.phrase.is_some() { + return Ok(None); + } + } for ts in terms.windows(2) { let [t1, t2] = ts else { panic!() }; if *t1.positions.end() != t2.positions.start() - 1 {