mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Fix PR comments
This commit is contained in:
parent
70d71581ee
commit
a918561ac1
7 changed files with 689 additions and 81 deletions
|
@ -1558,7 +1558,7 @@ impl Index {
|
|||
rtxn: &RoTxn<'_>,
|
||||
) -> heed::Result<Option<Vec<LocalizedAttributesRule>>> {
|
||||
self.main
|
||||
.remap_types::<Str, SerdeBincode<Vec<LocalizedAttributesRule>>>()
|
||||
.remap_types::<Str, SerdeJson<Vec<LocalizedAttributesRule>>>()
|
||||
.get(rtxn, main_key::LOCALIZED_ATTRIBUTES_RULES)
|
||||
}
|
||||
|
||||
|
@ -1567,7 +1567,7 @@ impl Index {
|
|||
txn: &mut RwTxn<'_>,
|
||||
val: Vec<LocalizedAttributesRule>,
|
||||
) -> heed::Result<()> {
|
||||
self.main.remap_types::<Str, SerdeBincode<Vec<LocalizedAttributesRule>>>().put(
|
||||
self.main.remap_types::<Str, SerdeJson<Vec<LocalizedAttributesRule>>>().put(
|
||||
txn,
|
||||
main_key::LOCALIZED_ATTRIBUTES_RULES,
|
||||
&val,
|
||||
|
|
|
@ -71,6 +71,8 @@ impl LocalizedFieldIds {
|
|||
for rule in rules {
|
||||
if rule.match_str(field_name) {
|
||||
locales.extend(rule.locales.iter());
|
||||
// Take the first rule that matches
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -346,5 +346,5 @@ fn normalize_facet_string(facet_string: &str, locales: Option<&[Language]>) -> S
|
|||
..Default::default()
|
||||
};
|
||||
|
||||
token.normalize(&options).lemma.to_string()
|
||||
token.normalize(&options).lemma.into_owned()
|
||||
}
|
||||
|
|
|
@ -1128,22 +1128,21 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> {
|
|||
Ok(changed)
|
||||
}
|
||||
|
||||
fn update_localized_attributes_rules(&mut self) -> Result<bool> {
|
||||
let changed = match &self.localized_attributes_rules {
|
||||
fn update_localized_attributes_rules(&mut self) -> Result<()> {
|
||||
match &self.localized_attributes_rules {
|
||||
Setting::Set(new) => {
|
||||
let old = self.index.localized_attributes_rules(self.wtxn)?;
|
||||
if old.as_ref() == Some(new) {
|
||||
false
|
||||
} else {
|
||||
if old.as_ref() != Some(new) {
|
||||
self.index.put_localized_attributes_rules(self.wtxn, new.clone())?;
|
||||
true
|
||||
}
|
||||
}
|
||||
Setting::Reset => self.index.delete_localized_attributes_rules(self.wtxn)?,
|
||||
Setting::NotSet => false,
|
||||
};
|
||||
Setting::Reset => {
|
||||
self.index.delete_localized_attributes_rules(self.wtxn)?;
|
||||
}
|
||||
Setting::NotSet => (),
|
||||
}
|
||||
|
||||
Ok(changed)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn execute<FP, FA>(mut self, progress_callback: FP, should_abort: FA) -> Result<()>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue