Fix an issue with settings diff and * in the searchable attributes

This commit is contained in:
Clément Renault 2024-05-29 14:49:09 +02:00 committed by ManyTheFish
parent 0c6e4b2f00
commit 1ab03c4ede

View File

@ -1112,12 +1112,11 @@ impl InnerIndexSettingsDiff {
|| self.old.proximity_precision != self.new.proximity_precision || self.old.proximity_precision != self.new.proximity_precision
} }
/// Returns only the additional searchable fields if any /// Returns only the additional searchable fields.
/// other searchable field has been modified, returns None. /// If any other searchable field has been modified, returns None.
pub fn only_additional_fields(&self) -> Option<HashSet<String>> { pub fn only_additional_fields(&self) -> Option<HashSet<String>> {
match (&self.old.user_defined_searchable_fields, &self.new.user_defined_searchable_fields) { match (&self.old.user_defined_searchable_fields, &self.new.user_defined_searchable_fields) {
(None, None) | (Some(_), None) => None, (None, None) | (Some(_), None) | (None, Some(_)) => None, // None means *
(None, Some(new)) => Some(new.iter().cloned().collect()),
(Some(old), Some(new)) => { (Some(old), Some(new)) => {
let old: HashSet<_> = old.iter().cloned().collect(); let old: HashSet<_> = old.iter().cloned().collect();
let new: HashSet<_> = new.iter().cloned().collect(); let new: HashSet<_> = new.iter().cloned().collect();