From 75caba8edd210041183fcf6d9cb9817707a16a25 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 7 Mar 2025 09:29:22 -0800 Subject: [PATCH] Fix: correct all results with whoosh queries --- src/paperless/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/paperless/views.py b/src/paperless/views.py index fdd7c21a4..347045699 100644 --- a/src/paperless/views.py +++ b/src/paperless/views.py @@ -70,9 +70,11 @@ class StandardPagination(PageNumberPagination): if hasattr(self.page.paginator.object_list, "saved_results"): results_page = self.page.paginator.object_list.saved_results[0] if results_page is not None: - for i in range(len(results_page.results.docs())): + for doc_num in results_page.results.docs(): try: - fields = results_page.results.fields(i) + fields = results_page.results.searcher.ixreader.stored_fields( + doc_num, + ) if "id" in fields: ids.append(fields["id"]) except Exception: