mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Introduce the highest_reverse_iter private method
This commit is contained in:
parent
ad0d311f8a
commit
7a5889bc5a
1 changed files with 28 additions and 0 deletions
|
@ -497,6 +497,34 @@ impl<'t> FacetStringIter<'t> {
|
||||||
.map(Right),
|
.map(Right),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn highest_reverse_iter<X, Y>(
|
||||||
|
rtxn: &'t heed::RoTxn,
|
||||||
|
index: &'t Index,
|
||||||
|
db: Database<X, Y>,
|
||||||
|
field_id: FieldId,
|
||||||
|
) -> heed::Result<Either<FacetStringGroupRevRange<'t>, FacetStringLevelZeroRevRange<'t>>> {
|
||||||
|
let highest_level = Self::highest_level(rtxn, db, field_id)?.unwrap_or(0);
|
||||||
|
match NonZeroU8::new(highest_level) {
|
||||||
|
Some(highest_level) => FacetStringGroupRevRange::new(
|
||||||
|
rtxn,
|
||||||
|
index.facet_id_string_docids,
|
||||||
|
field_id,
|
||||||
|
highest_level,
|
||||||
|
Unbounded,
|
||||||
|
Unbounded,
|
||||||
|
)
|
||||||
|
.map(Left),
|
||||||
|
None => FacetStringLevelZeroRevRange::new(
|
||||||
|
rtxn,
|
||||||
|
index.facet_id_string_docids,
|
||||||
|
field_id,
|
||||||
|
Unbounded,
|
||||||
|
Unbounded,
|
||||||
|
)
|
||||||
|
.map(Right),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'t> Iterator for FacetStringIter<'t> {
|
impl<'t> Iterator for FacetStringIter<'t> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue