mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
fix displayed attrs empty array bug
This commit is contained in:
@ -70,7 +70,7 @@ pub fn apply_settings_update(
|
||||
|
||||
match settings.searchable_attributes.clone() {
|
||||
UpdateState::Update(v) => {
|
||||
if v.len() == 1 && v[0] == "*" {
|
||||
if v.len() == 1 && v[0] == "*" || v.is_empty() {
|
||||
schema.set_all_fields_as_indexed();
|
||||
} else {
|
||||
schema.update_indexed(v)?;
|
||||
@ -86,7 +86,7 @@ pub fn apply_settings_update(
|
||||
match settings.displayed_attributes.clone() {
|
||||
UpdateState::Update(v) => {
|
||||
// safe to unwrap because len is 1
|
||||
if v.len() == 1 && v.iter().next().unwrap() == "*" {
|
||||
if v.len() == 1 && v.iter().next().unwrap() == "*" || v.is_empty() {
|
||||
schema.set_all_fields_as_displayed();
|
||||
} else {
|
||||
schema.update_displayed(v)?
|
||||
|
Reference in New Issue
Block a user