From 7c157fc442d467a4ce916f0547c79e836df093e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 28 Jun 2023 14:35:36 +0200 Subject: [PATCH] Document that the LevelEntry fields order is important --- milli/src/search/facet/facet_distribution_iter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/milli/src/search/facet/facet_distribution_iter.rs b/milli/src/search/facet/facet_distribution_iter.rs index 0c37906ef..722a30e6d 100644 --- a/milli/src/search/facet/facet_distribution_iter.rs +++ b/milli/src/search/facet/facet_distribution_iter.rs @@ -56,6 +56,9 @@ pub fn count_iterate_over_facet_distribution<'t, CB>( where CB: FnMut(&'t [u8], u64, DocumentId) -> Result>, { + /// # Important + /// The order of the fields determines the order in which the facet values will be returned. + /// This struct is inserted in a BinaryHeap and popped later on. #[derive(Debug, PartialOrd, Ord, PartialEq, Eq)] struct LevelEntry<'t> { /// The number of candidates in this entry.