mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Only reindex if the size increased
This commit is contained in:
parent
66bda2ce8a
commit
ed19b7c3c3
@ -196,12 +196,23 @@ 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) {
|
||||||
|
let previous_document_template_max_bytes =
|
||||||
|
document_template_max_bytes.set().unwrap_or(default_max_bytes().get());
|
||||||
|
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(
|
ReindexAction::push_action(
|
||||||
&mut reindex_action,
|
&mut reindex_action,
|
||||||
ReindexAction::RegeneratePrompts,
|
ReindexAction::RegeneratePrompts,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
distribution.apply(new_distribution);
|
distribution.apply(new_distribution);
|
||||||
api_key.apply(new_api_key);
|
api_key.apply(new_api_key);
|
||||||
|
Loading…
Reference in New Issue
Block a user