mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-09 22:48:54 +01:00
Only reindex if the size increased
This commit is contained in:
parent
66bda2ce8a
commit
ed19b7c3c3
@ -196,11 +196,22 @@ impl SettingsDiff {
|
|||||||
ReindexAction::RegeneratePrompts,
|
ReindexAction::RegeneratePrompts,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if document_template_max_bytes.apply(new_document_template_max_bytes) {
|
if document_template_max_bytes.apply(new_document_template_max_bytes) {
|
||||||
ReindexAction::push_action(
|
let previous_document_template_max_bytes =
|
||||||
&mut reindex_action,
|
document_template_max_bytes.set().unwrap_or(default_max_bytes().get());
|
||||||
ReindexAction::RegeneratePrompts,
|
let new_document_template_max_bytes =
|
||||||
)
|
new_document_template_max_bytes.set().unwrap_or(default_max_bytes().get());
|
||||||
|
|
||||||
|
// only reindex if the size increased. Reasoning:
|
||||||
|
// - size decrease is a performance optimization, so we don't reindex and we keep the more accurate vectors
|
||||||
|
// - size increase is an accuracy optimization, so we want to reindex
|
||||||
|
if new_document_template_max_bytes > previous_document_template_max_bytes {
|
||||||
|
ReindexAction::push_action(
|
||||||
|
&mut reindex_action,
|
||||||
|
ReindexAction::RegeneratePrompts,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
distribution.apply(new_distribution);
|
distribution.apply(new_distribution);
|
||||||
|
Loading…
Reference in New Issue
Block a user