From 01a405282827355908327aa29c0dc8e15cfb7d3f Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 17 Aug 2021 10:29:43 +0200 Subject: [PATCH] Move the FacetStringIter creation logic into a private new method --- milli/src/search/facet/facet_string.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/milli/src/search/facet/facet_string.rs b/milli/src/search/facet/facet_string.rs index ed5322607..1a9bf6d91 100644 --- a/milli/src/search/facet/facet_string.rs +++ b/milli/src/search/facet/facet_string.rs @@ -298,6 +298,16 @@ impl<'t> FacetStringIter<'t> { index: &'t Index, field_id: FieldId, documents_ids: RoaringBitmap, + ) -> heed::Result> { + 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> { let db = index.facet_id_string_docids.remap_types::(); 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, }) }