mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Move the FacetStringIter creation logic into a private new method
This commit is contained in:
parent
51581d14f8
commit
01a4052828
1 changed files with 11 additions and 1 deletions
|
@ -298,6 +298,16 @@ impl<'t> FacetStringIter<'t> {
|
|||
index: &'t Index,
|
||||
field_id: FieldId,
|
||||
documents_ids: RoaringBitmap,
|
||||
) -> heed::Result<FacetStringIter<'t>> {
|
||||
FacetStringIter::new(rtxn, index, field_id, documents_ids, false)
|
||||
}
|
||||
|
||||
fn new(
|
||||
rtxn: &'t heed::RoTxn,
|
||||
index: &'t Index,
|
||||
field_id: FieldId,
|
||||
documents_ids: RoaringBitmap,
|
||||
must_reduce: bool,
|
||||
) -> heed::Result<FacetStringIter<'t>> {
|
||||
let db = index.facet_id_string_docids.remap_types::<ByteSlice, ByteSlice>();
|
||||
let highest_level = Self::highest_level(rtxn, db, field_id)?.unwrap_or(0);
|
||||
|
@ -324,7 +334,7 @@ impl<'t> FacetStringIter<'t> {
|
|||
db,
|
||||
field_id,
|
||||
level_iters: vec![(documents_ids, highest_iter)],
|
||||
must_reduce: false,
|
||||
must_reduce,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue