mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Use the sorter cache when collection prefix docids
This commit is contained in:
parent
a3beaa90c5
commit
0e08906fcb
4 changed files with 43 additions and 49 deletions
|
@ -140,6 +140,10 @@ where
|
|||
self.sorter.insert(key, value_writer.into_inner().unwrap())
|
||||
}
|
||||
|
||||
pub fn direct_insert(&mut self, key: &[u8], val: &[u8]) -> Result<(), grenad::Error<U>> {
|
||||
self.sorter.insert(key, val)
|
||||
}
|
||||
|
||||
pub fn into_sorter(mut self) -> Result<grenad::Sorter<MF>, grenad::Error<U>> {
|
||||
let default_lru = LruCache::new(NonZeroUsize::MIN);
|
||||
for (key, deladd) in mem::replace(&mut self.cache, default_lru) {
|
||||
|
@ -155,10 +159,6 @@ pub struct DelAddRoaringBitmap {
|
|||
}
|
||||
|
||||
impl DelAddRoaringBitmap {
|
||||
fn new_del_add(bitmap: RoaringBitmap) -> Self {
|
||||
DelAddRoaringBitmap { del: Some(bitmap.clone()), add: Some(bitmap) }
|
||||
}
|
||||
|
||||
fn new_del_add_u32(n: u32) -> Self {
|
||||
DelAddRoaringBitmap {
|
||||
del: Some(RoaringBitmap::from([n])),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue