changeset 848:ac386d2622af

small cleanup, add language for attachments
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Thu, 15 Jun 2006 16:44:16 +0200
parents 813125ff0d74
children 02d6697b000d
files MoinMoin/Xapian.py MoinMoin/search.py docs/CHANGES.fpletz
diffstat 3 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Xapian.py	Thu Jun 15 16:11:28 2006 +0200
+++ b/MoinMoin/Xapian.py	Thu Jun 15 16:44:16 2006 +0200
@@ -631,11 +631,12 @@
                 xattachment = xapdoc.SortKey('attachment', att) # this is an attachment, store its filename
                 xmtime = xapdoc.SortKey('mtime', mtime)
                 xtitle = xapdoc.Keyword('title', '%s/%s' % (pagename, att))
+                xlanguage = xapdoc.Keyword('lang', language)
                 mimetype, att_content = self.contentfilter(filename)
                 xmimetype = xapdoc.TextField('mimetype', mimetype, True)
                 xcontent = xapdoc.TextField('content', att_content)
                 doc = xapdoc.Document(textFields=(xcontent, xmimetype, ),
-                                      keywords=(xatt_itemid, xtitle, ),
+                                      keywords=(xatt_itemid, xtitle, xlanguage),
                                       sortFields=(xpname, xattachment, xmtime, xwname, ),
                                      )
                 doc.analyzerFactory = WikiAnalyzer
--- a/MoinMoin/search.py	Thu Jun 15 16:11:28 2006 +0200
+++ b/MoinMoin/search.py	Thu Jun 15 16:44:16 2006 +0200
@@ -495,7 +495,7 @@
         @param use_re: treat pattern as re of plain text, bool
         @param case: do case sensitive search, bool 
         """
-        # used for search in languages, always lowercase
+        # iso language code, always lowercase
         self._pattern = pattern.lower()
         self.negated = 0
         self.use_re = use_re
--- a/docs/CHANGES.fpletz	Thu Jun 15 16:11:28 2006 +0200
+++ b/docs/CHANGES.fpletz	Thu Jun 15 16:44:16 2006 +0200
@@ -12,6 +12,7 @@
   ToDo:
     * HACK: MoinMoin.Xapian.Index._get_languages (wait for proper metadata)
     * Mockup the new search UI
+    * Write/update documentation for all the new search stuff
 
   New Features:
     * Faster search thanks to Xapian