From d1ddaa223d39b7ba74fde7f9a72b04662931935f Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 5 Apr 2023 18:05:44 +0200 Subject: [PATCH] Use correct codec in proximity --- .../ranking_rule_graph/proximity/compute_docids.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/milli/src/search/new/ranking_rule_graph/proximity/compute_docids.rs b/milli/src/search/new/ranking_rule_graph/proximity/compute_docids.rs index 8496054b7..07bd102ca 100644 --- a/milli/src/search/new/ranking_rule_graph/proximity/compute_docids.rs +++ b/milli/src/search/new/ranking_rule_graph/proximity/compute_docids.rs @@ -1,14 +1,17 @@ #![allow(clippy::too_many_arguments)] +use std::collections::BTreeSet; + +use heed::BytesDecode; +use roaring::RoaringBitmap; + use super::ProximityCondition; use crate::search::new::interner::Interned; use crate::search::new::query_term::{Phrase, QueryTermSubset}; use crate::search::new::ranking_rule_graph::ComputedCondition; use crate::search::new::resolve_query_graph::compute_query_term_subset_docids; use crate::search::new::SearchContext; -use crate::{CboRoaringBitmapCodec, Result}; -use roaring::RoaringBitmap; -use std::collections::BTreeSet; +use crate::{CboRoaringBitmapCodec, Result, RoaringBitmapCodec}; pub fn compute_docids( ctx: &mut SearchContext, @@ -90,7 +93,8 @@ pub fn compute_docids( continue; } } else if let Some(lw_bytes) = ctx.get_db_word_docids(left_word)? { - let left_word_docids = CboRoaringBitmapCodec::deserialize_from(lw_bytes)?; + let left_word_docids = + RoaringBitmapCodec::bytes_decode(lw_bytes).ok_or(heed::Error::Decoding)?; if universe.is_disjoint(&left_word_docids) { continue; }