mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 17:14:59 +08:00
Move the FacetStringIter creation logic into a private new method
This commit is contained in:
parent
51581d14f8
commit
01a4052828
@ -298,6 +298,16 @@ impl<'t> FacetStringIter<'t> {
|
|||||||
index: &'t Index,
|
index: &'t Index,
|
||||||
field_id: FieldId,
|
field_id: FieldId,
|
||||||
documents_ids: RoaringBitmap,
|
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>> {
|
) -> heed::Result<FacetStringIter<'t>> {
|
||||||
let db = index.facet_id_string_docids.remap_types::<ByteSlice, ByteSlice>();
|
let db = index.facet_id_string_docids.remap_types::<ByteSlice, ByteSlice>();
|
||||||
let highest_level = Self::highest_level(rtxn, db, field_id)?.unwrap_or(0);
|
let highest_level = Self::highest_level(rtxn, db, field_id)?.unwrap_or(0);
|
||||||
@ -324,7 +334,7 @@ impl<'t> FacetStringIter<'t> {
|
|||||||
db,
|
db,
|
||||||
field_id,
|
field_id,
|
||||||
level_iters: vec![(documents_ids, highest_iter)],
|
level_iters: vec![(documents_ids, highest_iter)],
|
||||||
must_reduce: false,
|
must_reduce,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user