mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
add distinct attributes to cli
This commit is contained in:
parent
49fbbacafc
commit
bbb6728d2f
@ -469,6 +469,8 @@ struct SettingsUpdate {
|
|||||||
criteria: Option<Vec<String>>,
|
criteria: Option<Vec<String>>,
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
exact_attributes: Option<Vec<String>>,
|
exact_attributes: Option<Vec<String>>,
|
||||||
|
#[structopt(long)]
|
||||||
|
distinct_attribute: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Performer for SettingsUpdate {
|
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 mut bars = Vec::new();
|
||||||
let progesses = MultiProgress::new();
|
let progesses = MultiProgress::new();
|
||||||
for _ in 0..4 {
|
for _ in 0..4 {
|
||||||
|
@ -243,6 +243,8 @@ impl<'a> Search<'a> {
|
|||||||
excluded_candidates = candidates.into_excluded();
|
excluded_candidates = candidates.into_excluded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbg!(excluded_candidates.len());
|
||||||
|
|
||||||
Ok(SearchResult { matching_words, candidates: initial_candidates, documents_ids })
|
Ok(SearchResult { matching_words, candidates: initial_candidates, documents_ids })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user