From 66abac9364265da9896a33c24bc76249bb063bcb Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 23 Oct 2023 15:55:35 +0200 Subject: [PATCH] Use specialized `KvReaderDelAdd` type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Renault --- milli/src/update/facet/bulk.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/milli/src/update/facet/bulk.rs b/milli/src/update/facet/bulk.rs index d2205f9d6..297d189cd 100644 --- a/milli/src/update/facet/bulk.rs +++ b/milli/src/update/facet/bulk.rs @@ -4,7 +4,6 @@ use std::io::BufReader; use grenad::CompressionType; use heed::types::ByteSlice; use heed::{BytesEncode, Error, RoTxn, RwTxn}; -use obkv::KvReader; use roaring::RoaringBitmap; use super::{FACET_GROUP_SIZE, FACET_MIN_LEVEL_SIZE}; @@ -13,7 +12,7 @@ use crate::heed_codec::facet::{ FacetGroupKey, FacetGroupKeyCodec, FacetGroupValue, FacetGroupValueCodec, }; use crate::heed_codec::ByteSliceRefCodec; -use crate::update::del_add::DelAdd; +use crate::update::del_add::{DelAdd, KvReaderDelAdd}; use crate::update::index_documents::{create_writer, valid_lmdb_key, writer_into_reader}; use crate::{CboRoaringBitmapCodec, FieldId, Index, Result}; @@ -135,7 +134,7 @@ impl FacetsUpdateBulkInner { if !valid_lmdb_key(key) { continue; } - let value: KvReader = KvReader::new(value); + let value = KvReaderDelAdd::new(value); // DB is empty, it is safe to ignore Del operations let Some(value) = value.get(DelAdd::Addition) else { @@ -159,7 +158,7 @@ impl FacetsUpdateBulkInner { continue; } - let value: KvReader = KvReader::new(value); + let value = KvReaderDelAdd::new(value); // the value is a CboRoaringBitmap, but I still need to prepend the // group size for level 0 (= 1) to it