mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 05:30:16 +01:00
implement check
This commit is contained in:
parent
706643dfed
commit
8d11b368d1
@ -75,8 +75,38 @@ impl Settings<Checked> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Settings<Unchecked> {
|
impl Settings<Unchecked> {
|
||||||
pub fn check(self) -> Settings<Checked> {
|
pub fn check(mut self) -> Settings<Checked> {
|
||||||
todo!()
|
let displayed_attributes = match self.displayed_attributes.take() {
|
||||||
|
Some(Some(fields)) => {
|
||||||
|
if fields.iter().any(|f| f == "*") {
|
||||||
|
Some(None)
|
||||||
|
} else {
|
||||||
|
Some(Some(fields))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
otherwise => otherwise,
|
||||||
|
};
|
||||||
|
|
||||||
|
let searchable_attributes = match self.searchable_attributes.take() {
|
||||||
|
Some(Some(fields)) => {
|
||||||
|
if fields.iter().any(|f| f == "*") {
|
||||||
|
Some(None)
|
||||||
|
} else {
|
||||||
|
Some(Some(fields))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
otherwise => otherwise,
|
||||||
|
};
|
||||||
|
|
||||||
|
Settings {
|
||||||
|
displayed_attributes,
|
||||||
|
searchable_attributes,
|
||||||
|
attributes_for_faceting: self.attributes_for_faceting,
|
||||||
|
ranking_rules: self.ranking_rules,
|
||||||
|
stop_words: self.stop_words,
|
||||||
|
distinct_attribute: self.distinct_attribute,
|
||||||
|
_kind: PhantomData,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user