Keep old stat format to make sure the number of documents is available during dumpless upgrade

This commit is contained in:
Louis Dureuil 2025-02-27 11:51:35 +01:00 committed by Kerollmops
parent c5cb7d2f2c
commit 046bbea864
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
2 changed files with 9 additions and 1 deletions

View file

@ -514,7 +514,10 @@ pub struct IndexStats {
impl From<index_scheduler::IndexStats> for IndexStats {
fn from(stats: index_scheduler::IndexStats) -> Self {
IndexStats {
number_of_documents: stats.inner_stats.documents_database_stats.number_of_entries(),
number_of_documents: stats
.inner_stats
.number_of_documents
.unwrap_or(stats.inner_stats.documents_database_stats.number_of_entries()),
raw_document_db_size: stats.inner_stats.documents_database_stats.total_value_size(),
avg_document_size: stats.inner_stats.documents_database_stats.average_value_size(),
is_indexing: stats.is_indexing,