changeset 4541:38110c49d0a6

Xapian indexing: in update mode, do not try to re-index old revisions again
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Feb 2009 17:15:09 +0100
parents 0d03855518a4
children 9a3e85b44c25
files MoinMoin/search/Xapian.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py	Thu Jan 29 21:37:44 2009 +0100
+++ b/MoinMoin/search/Xapian.py	Sun Feb 01 17:15:09 2009 +0100
@@ -438,7 +438,11 @@
         p = Page(request, pagename)
         if request.cfg.xapian_index_history:
             for rev in p.getRevList():
-                self._index_page_rev(request, writer, Page(request, pagename, rev=rev), mode=mode)
+                updated = self._index_page_rev(request, writer, Page(request, pagename, rev=rev), mode=mode)
+                logging.debug("updated page %r rev %d (updated==%r)" % (pagename, rev, updated))
+                if not updated:
+                    # we reached the revisions that are already present in the index
+                    break
         else:
             self._index_page_rev(request, writer, p, mode=mode)
 
@@ -581,7 +585,7 @@
             elif mode == 'add':
                 logging.debug("%s (add)" % (pagename, ))
                 id = writer.index(doc)
-
+        return updated
 
     def _remove_item(self, request, writer, page, attachment=None):
         wikiname = request.cfg.interwikiname or u'Self'