changeset 444:6b4f5e5850a3

fixed issue with destroying items. Revisions don't deleted from all revisions index Fixes #33.
author Michael Mayorov <marchael@kb.csu.ru>
date Tue, 16 Aug 2011 15:32:30 +0000
parents b8ebdf2c816e
children 0f29cbb71223
files MoinMoin/storage/backends/indexing.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/backends/indexing.py	Tue Aug 16 02:44:29 2011 +0000
+++ b/MoinMoin/storage/backends/indexing.py	Tue Aug 16 15:32:30 2011 +0000
@@ -228,7 +228,15 @@
             with AsyncWriter(self.index_object.latest_revisions_index) as async_writer:
                 async_writer.delete_document(doc_number)
 
-        # XXX must be deleted from all_revisions_index also
+        with self.index_object.all_revisions_index.searcher() as all_revs_searcher:
+            doc_numbers = list(all_revs_searcher.document_numbers(uuid=metas[UUID],
+                                                                  name_exact=metas[NAME],
+                                                                  wikiname=self.wikiname
+                                                                 ))
+        if doc_numbers:
+            with AsyncWriter(self.index_object.all_revisions_index) as async_writer:
+                for doc_number in doc_numbers:
+                    async_writer.delete_document(doc_number)
 
     def add_rev(self, uuid, revno, rev):
         """