From 40fa59d64ca5bc105cc79dc9b884b9fd45ac6268 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 10 Jul 2023 09:26:59 +0200 Subject: [PATCH] Sort by lexicographic order after normalization --- milli/src/update/settings.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 5b8e5a21c..33f86a4bb 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -425,13 +425,14 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> { let current = self.index.stop_words(self.wtxn)?; // Apply an unlossy normalization on stop_words - let stop_words = stop_words + let stop_words: BTreeSet = stop_words .iter() - .map(|w| w.as_str().normalize(&Default::default()).into_owned()); + .map(|w| w.as_str().normalize(&Default::default()).into_owned()) + .collect(); // since we can't compare a BTreeSet with an FST we are going to convert the // BTreeSet to an FST and then compare bytes per bytes the two FSTs. - let fst = fst::Set::from_iter(stop_words)?; + let fst = fst::Set::from_iter(stop_words.into_iter())?; // Does the new FST differ from the previous one? if current