mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 08:44:27 +01:00
Fix Prefix FST when a document is modified
This commit is contained in:
parent
d79f75f630
commit
774ed28539
@ -234,12 +234,18 @@ impl PrefixFstBuilder {
|
||||
*current_prefix_is_modified = false;
|
||||
}
|
||||
|
||||
*current_prefix_is_modified |= is_modified;
|
||||
|
||||
if deladd == DelAdd::Addition {
|
||||
*current_prefix_count += 1;
|
||||
}
|
||||
|
||||
if is_modified && !*current_prefix_is_modified {
|
||||
if *current_prefix_count > self.prefix_count_threshold {
|
||||
self.modified_prefixes.insert(current_prefix.clone());
|
||||
}
|
||||
|
||||
*current_prefix_is_modified = true;
|
||||
}
|
||||
|
||||
// There is enough words corresponding to this prefix to add it to the cache.
|
||||
if *current_prefix_count == self.prefix_count_threshold {
|
||||
builder.insert(prefix)?;
|
||||
|
Loading…
Reference in New Issue
Block a user