changeset 419:2e8c562f7524

indexing: clarify ItemIndex.update_item/remove_item, remove wrong code
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 07 Aug 2011 22:34:23 +0200
parents e362e7abfda6
children e2d16dadf565
files MoinMoin/storage/backends/indexing.py
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/backends/indexing.py	Sun Aug 07 18:50:13 2011 +0200
+++ b/MoinMoin/storage/backends/indexing.py	Sun Aug 07 22:34:23 2011 +0200
@@ -216,23 +216,12 @@
         """
         update item (not revision!) metadata
         """
-        return
-        # XXX wrong, this is for item level metadata, not revision metadata!
-        with self.index_object.latest_revisions_index.searcher() as latest_revs_searcher:
-            doc_number = latest_revs_searcher.document_number(uuid=metas[UUID],
-                                                              wikiname=self.wikiname
-                                                             )
-        with AsyncWriter(self.index_object.latest_revisions_index) as async_writer:
-            if doc_number:
-                async_writer.delete_document(doc_number)
-            async_writer.add_document(**metas)
+        # XXX we do not have an index for item metadata yet!
 
     def remove_item(self, metas):
         """
-        remove item (not revision!) metadata
+        remove all data related to this item and all its revisions from the index
         """
-        return
-        # XXX wrong, this is for item level metadata, not revision metadata!
         with self.index_object.latest_revisions_index.searcher() as latest_revs_searcher:
             doc_number = latest_revs_searcher.document_number(uuid=metas[UUID],
                                                               name_exact=metas[NAME],
@@ -242,6 +231,8 @@
             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
+
     def add_rev(self, uuid, revno, rev):
         """
         add a new revision <revno> for item <uuid> with metadata <metas>