From 0f9710dc8fcb9cbb6ca4a79ea16bb597728ad3c1 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:33:01 -0700 Subject: [PATCH] Fix: index fresh document data after update archive file (#7057) --- src/documents/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/documents/tasks.py b/src/documents/tasks.py index 5dd5c5e0f..f3eb258b8 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -285,6 +285,10 @@ def update_document_archive_file(document_id): shutil.move(parser.get_archive_path(), document.archive_path) shutil.move(thumbnail, document.thumbnail_path) + document.refresh_from_db() + logger.info( + f"Updating index for document {document_id} ({document.archive_checksum})", + ) with index.open_index_writer() as writer: index.update_document(writer, document)