diff --git a/cli/src/main.rs b/cli/src/main.rs index 3e9e8c75f..97580142b 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -469,6 +469,8 @@ struct SettingsUpdate { criteria: Option>, #[structopt(long)] exact_attributes: Option>, + #[structopt(long)] + distinct_attribute: Option, } impl Performer for SettingsUpdate { @@ -503,6 +505,14 @@ impl Performer for SettingsUpdate { } } + if let Some(distinct_attr) = self.distinct_attribute { + if !distinct_attr.is_empty() { + update.set_distinct_field(distinct_attr); + } else { + update.reset_distinct_field(); + } + } + let mut bars = Vec::new(); let progesses = MultiProgress::new(); for _ in 0..4 { diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index b01bae817..d53bcafb7 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -243,6 +243,8 @@ impl<'a> Search<'a> { excluded_candidates = candidates.into_excluded(); } + dbg!(excluded_candidates.len()); + Ok(SearchResult { matching_words, candidates: initial_candidates, documents_ids }) } }