add exact prefix to query_docids

This commit is contained in:
ad hoc 2022-03-25 16:30:18 +01:00
parent 21ae4143b1
commit 56b4f5dce2
No known key found for this signature in database
GPG Key ID: 4F00A782990CC643

View File

@ -404,7 +404,9 @@ fn query_docids(
match &query.kind { match &query.kind {
QueryKind::Exact { word, .. } => { QueryKind::Exact { word, .. } => {
if query.prefix && ctx.in_prefix_cache(&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 { } else if query.prefix {
let words = word_derivations(&word, true, 0, ctx.words_fst(), wdcache)?; let words = word_derivations(&word, true, 0, ctx.words_fst(), wdcache)?;
let mut docids = RoaringBitmap::new(); let mut docids = RoaringBitmap::new();