From 56b4f5dce2a32505e6e25b973880b7d682e4d4be Mon Sep 17 00:00:00 2001 From: ad hoc Date: Fri, 25 Mar 2022 16:30:18 +0100 Subject: [PATCH] add exact prefix to query_docids --- milli/src/search/criteria/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/milli/src/search/criteria/mod.rs b/milli/src/search/criteria/mod.rs index 3daa258bf..6ac076ea4 100644 --- a/milli/src/search/criteria/mod.rs +++ b/milli/src/search/criteria/mod.rs @@ -404,7 +404,9 @@ fn query_docids( match &query.kind { QueryKind::Exact { word, .. } => { if query.prefix && ctx.in_prefix_cache(&word) { - Ok(ctx.word_prefix_docids(&word)?.unwrap_or_default()) + let doc_ids = ctx.word_prefix_docids(&word)?.unwrap_or_default(); + let exact_docids = ctx.exact_word_prefix_docids(&word)?.unwrap_or_default(); + Ok(doc_ids | exact_docids) } else if query.prefix { let words = word_derivations(&word, true, 0, ctx.words_fst(), wdcache)?; let mut docids = RoaringBitmap::new();