mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 10:07:40 +08:00
Do not forget to recompute common prefixes
This commit is contained in:
parent
ad52c950ba
commit
db55638714
@ -265,16 +265,18 @@ where
|
|||||||
let prefix_settings = index.prefix_settings(&rtxn)?;
|
let prefix_settings = index.prefix_settings(&rtxn)?;
|
||||||
word_fst_builder.with_prefix_settings(prefix_settings);
|
word_fst_builder.with_prefix_settings(prefix_settings);
|
||||||
|
|
||||||
let previous_words = index.word_docids.iter(&rtxn)?.remap_data_type::<DecodeIgnore>();
|
let previous_words = index.word_docids.iter(&rtxn)?.remap_data_type::<Bytes>();
|
||||||
let current_words = index.word_docids.iter(wtxn)?.remap_data_type::<DecodeIgnore>();
|
let current_words = index.word_docids.iter(wtxn)?.remap_data_type::<Bytes>();
|
||||||
for eob in merge_join_by(previous_words, current_words, |lhs, rhs| match (lhs, rhs) {
|
for eob in merge_join_by(previous_words, current_words, |lhs, rhs| match (lhs, rhs) {
|
||||||
(Ok((l, _)), Ok((r, _))) => l.cmp(r),
|
(Ok((l, _)), Ok((r, _))) => l.cmp(r),
|
||||||
(Err(_), _) | (_, Err(_)) => Ordering::Equal,
|
(Err(_), _) | (_, Err(_)) => Ordering::Equal,
|
||||||
}) {
|
}) {
|
||||||
match eob {
|
match eob {
|
||||||
EitherOrBoth::Both(lhs, rhs) => {
|
EitherOrBoth::Both(lhs, rhs) => {
|
||||||
if let Some(e) = lhs.err().or(rhs.err()) {
|
let (word, lhs_bytes) = lhs?;
|
||||||
return Err(e.into());
|
let (_, rhs_bytes) = rhs?;
|
||||||
|
if lhs_bytes != rhs_bytes {
|
||||||
|
word_fst_builder.register_word(DelAdd::Addition, word.as_ref())?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EitherOrBoth::Left(result) => {
|
EitherOrBoth::Left(result) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user