changeset 1368:949341c1c5ed

index author und revision number
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Fri, 18 Aug 2006 13:12:57 +0200
parents 4c29aeea8bf7
children 0a291dcb0555
files MoinMoin/search/Xapian.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py	Fri Aug 18 12:56:41 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Fri Aug 18 13:12:57 2006 +0200
@@ -152,7 +152,7 @@
         # http://svn.xapian.org/*checkout*/trunk/xapian-applications/omega/docs/termprefixes.txt
         'author': 'A',
         'date':   'D', # numeric format: YYYYMMDD or "latest" - e.g. D20050224 or Dlatest
-                       #G   newsGroup (or similar entity - e.g. a web forum name)
+                       #G   newsGroup (or sim2006-08-17 05:11:53ilar entity - e.g. a web forum name)
         'hostname': 'H',
         'keyword': 'K',
         'lang': 'L',   # ISO Language code
@@ -174,6 +174,7 @@
         'category': 'XCAT', # category this document belongs to
         'full_title': 'XFT', # full title (for regex)
         'domain': 'XDOMAIN', # standard or underlay
+        'revision': 'XREV', # revision of page
                        #Y   year (four digits)
     }
 
@@ -364,6 +365,8 @@
         pagename = page.page_name
         mtime = page.mtime_usecs()
         itemid = "%s:%s" % (wikiname, pagename)
+        revision = str(page.get_real_rev())
+        author = page.last_edit(request)['editor']
         # XXX: Hack until we get proper metadata
         language, stem_language = self._get_languages(page)
         categories = self._get_categories(page)
@@ -397,7 +400,9 @@
             xkeywords = [xapdoc.Keyword('itemid', itemid),
                     xapdoc.Keyword('lang', language),
                     xapdoc.Keyword('stem_lang', stem_language),
-                    xapdoc.Keyword('full_title', pagename.lower())]
+                    xapdoc.Keyword('full_title', pagename.lower()),
+                    xapdoc.Keyword('revision', revision),
+                    xapdoc.Keyword('author', author)]
             for pagelink in page.getPageLinks(request):
                 xkeywords.append(xapdoc.Keyword('linkto', pagelink))
             for category in categories: