mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
add displayed attributes wildcard
This commit is contained in:
parent
4262561596
commit
7f5fb50307
2 changed files with 114 additions and 16 deletions
|
@ -80,7 +80,11 @@ pub fn apply_settings_update(
|
|||
|
||||
match settings.searchable_attributes.clone() {
|
||||
UpdateState::Update(v) => {
|
||||
schema.update_indexed(v)?;
|
||||
if v.len() == 1 && v[0] == "*" {
|
||||
schema.set_all_fields_as_indexed();
|
||||
} else {
|
||||
schema.update_indexed(v)?;
|
||||
}
|
||||
must_reindex = true;
|
||||
},
|
||||
UpdateState::Clear => {
|
||||
|
@ -90,7 +94,14 @@ pub fn apply_settings_update(
|
|||
UpdateState::Nothing => (),
|
||||
}
|
||||
match settings.displayed_attributes.clone() {
|
||||
UpdateState::Update(v) => schema.update_displayed(v)?,
|
||||
UpdateState::Update(v) => {
|
||||
// safe to unwrap because len is 1
|
||||
if v.len() == 1 && v.iter().next().unwrap() == "*" {
|
||||
schema.set_all_fields_as_displayed();
|
||||
} else {
|
||||
schema.update_displayed(v)?
|
||||
}
|
||||
},
|
||||
UpdateState::Clear => {
|
||||
schema.set_all_fields_as_displayed();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue