From 21c6123a3653ccce3c3e03970b04477ac18e025c Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Tue, 3 Oct 2023 17:58:08 +0200 Subject: [PATCH] Remove prefix dbs --- milli/src/search/new/db_cache.rs | 9 +++++++++ milli/src/update/index_documents/mod.rs | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/milli/src/search/new/db_cache.rs b/milli/src/search/new/db_cache.rs index e0a2ba3cf..0c5adc36f 100644 --- a/milli/src/search/new/db_cache.rs +++ b/milli/src/search/new/db_cache.rs @@ -192,6 +192,7 @@ impl<'ctx> SearchContext<'ctx> { } pub fn word_prefix_docids(&mut self, prefix: Word) -> Result> { + unreachable!(); match prefix { Word::Original(prefix) => { let exact = self.get_db_exact_word_prefix_docids(prefix)?; @@ -216,6 +217,7 @@ impl<'ctx> SearchContext<'ctx> { &mut self, prefix: Interned, ) -> Result> { + unreachable!(); match &self.restricted_fids { Some(restricted_fids) => { let interned = self.word_interner.get(prefix).as_str(); @@ -244,6 +246,7 @@ impl<'ctx> SearchContext<'ctx> { &mut self, prefix: Interned, ) -> Result> { + unreachable!(); DatabaseCache::get_value::<_, _, RoaringBitmapCodec>( self.txn, prefix, @@ -297,6 +300,7 @@ impl<'ctx> SearchContext<'ctx> { prefix2: Interned, proximity: u8, ) -> Result> { + unreachable!(); DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>( self.txn, (proximity, word1, prefix2), @@ -315,6 +319,7 @@ impl<'ctx> SearchContext<'ctx> { right: Interned, proximity: u8, ) -> Result> { + unreachable!(); DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>( self.txn, (proximity, left_prefix, right), @@ -352,6 +357,7 @@ impl<'ctx> SearchContext<'ctx> { word_prefix: Interned, fid: u16, ) -> Result> { + unreachable!(); // if the requested fid isn't in the restricted list, return None. if self.restricted_fids.as_ref().map_or(false, |fids| !fids.contains(&fid)) { return Ok(None); @@ -393,6 +399,7 @@ impl<'ctx> SearchContext<'ctx> { } pub fn get_db_word_prefix_fids(&mut self, word_prefix: Interned) -> Result> { + unreachable!(); let fids = match self.db_cache.word_prefix_fids.entry(word_prefix) { Entry::Occupied(fids) => fids.get().clone(), Entry::Vacant(entry) => { @@ -439,6 +446,7 @@ impl<'ctx> SearchContext<'ctx> { word_prefix: Interned, position: u16, ) -> Result> { + unreachable!(); DatabaseCache::get_value::<_, _, CboRoaringBitmapCodec>( self.txn, (word_prefix, position), @@ -480,6 +488,7 @@ impl<'ctx> SearchContext<'ctx> { &mut self, word_prefix: Interned, ) -> Result> { + unreachable!(); let positions = match self.db_cache.word_prefix_positions.entry(word_prefix) { Entry::Occupied(positions) => positions.get().clone(), Entry::Vacant(entry) => { diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 52aa1113e..2764f239e 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -470,13 +470,13 @@ where let all_documents_ids = index_documents_ids | new_documents_ids; self.index.put_documents_ids(self.wtxn, &all_documents_ids)?; - self.execute_prefix_databases( - word_docids, - exact_word_docids, - word_pair_proximity_docids, - word_position_docids, - word_fid_docids, - )?; + // self.execute_prefix_databases( + // word_docids, + // exact_word_docids, + // word_pair_proximity_docids, + // word_position_docids, + // word_fid_docids, + // )?; Ok(all_documents_ids.len()) }