changeset 3630:a53307694ba3

Xapian mimetype search: consistently use a Keyword for mimetype, use text/<format> as mimetype for pages
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 20 May 2008 23:17:24 +0200
parents bf72cc397f76
children 6907fd1613a5
files MoinMoin/search/Xapian.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py	Tue May 20 19:33:22 2008 +0200
+++ b/MoinMoin/search/Xapian.py	Tue May 20 23:17:24 2008 +0200
@@ -368,10 +368,10 @@
                 xrev = xapdoc.SortKey('revision', '0')
                 title = " ".join(os.path.join(fs_rootpage, filename).split("/"))
                 xtitle = xapdoc.Keyword('title', title)
-                xmimetype = xapdoc.TextField('mimetype', mimetype, True)
+                xmimetype = xapdoc.Keyword('mimetype', mimetype)
                 xcontent = xapdoc.TextField('content', file_content)
-                doc = xapdoc.Document(textFields=(xcontent, xmimetype, ),
-                                      keywords=(xtitle, xitemid, ),
+                doc = xapdoc.Document(textFields=(xcontent, ),
+                                      keywords=(xtitle, xitemid, xmimetype, ),
                                       sortFields=(xpname, xattachment,
                                           xmtime, xwname, xrev, ),
                                      )
@@ -503,6 +503,7 @@
                     xapdoc.Keyword('fulltitle', pagename),
                     xapdoc.Keyword('revision', revision),
                     xapdoc.Keyword('author', author),
+                    xapdoc.Keyword('mimetype', 'text/%s' % page.pi['format']), # XXX improve this
                 ]
             for pagelink in page.getPageLinks(request):
                 xkeywords.append(xapdoc.Keyword('linkto', pagelink))