add distinct attributes to cli

This commit is contained in:
ad hoc 2022-04-08 17:32:22 +02:00 committed by Clémentine Urquizar
parent 49fbbacafc
commit bbb6728d2f
No known key found for this signature in database
GPG Key ID: D8E7CC7422E77E1A
2 changed files with 12 additions and 0 deletions

View File

@ -469,6 +469,8 @@ struct SettingsUpdate {
criteria: Option<Vec<String>>,
#[structopt(long)]
exact_attributes: Option<Vec<String>>,
#[structopt(long)]
distinct_attribute: Option<String>,
}
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 {

View File

@ -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 })
}
}