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
}
/// Returns only the additional searchable fields if any
/// other searchable field has been modified, returns None.
/// Returns only the additional searchable fields.
/// If any other searchable field has been modified, returns None.
pub fn only_additional_fields(&self) -> Option<HashSet<String>> {
match (&self.old.user_defined_searchable_fields, &self.new.user_defined_searchable_fields) {
(None, None) | (Some(_), None) => None,
(None, Some(new)) => Some(new.iter().cloned().collect()),
(None, None) | (Some(_), None) | (None, Some(_)) => None, // None means *
(Some(old), Some(new)) => {
let old: HashSet<_> = old.iter().cloned().collect();
let new: HashSet<_> = new.iter().cloned().collect();