changeset 1524:2564531181d8

merged sync branch
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 03 Sep 2006 03:30:03 +0200
parents ac7e2218a298 (current diff) 2f4c0bc79175 (diff)
children 6efd969a704f
files MoinMoin/action/fullsearch.py MoinMoin/search/builtin.py
diffstat 4 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/AdvancedSearch.py	Sun Sep 03 02:34:18 2006 +0200
+++ b/MoinMoin/macro/AdvancedSearch.py	Sun Sep 03 03:30:03 2006 +0200
@@ -89,7 +89,7 @@
     # mimetype selection
     mimetype = form_get(request, 'mimetype')
     mt_select = makeSelection('mimetype',
-            [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())],
+            [('', 'any mimetype')] + [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())],
             mimetype)
 
 
--- a/MoinMoin/search/Xapian.py	Sun Sep 03 02:34:18 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Sun Sep 03 03:30:03 2006 +0200
@@ -546,6 +546,7 @@
             if updated:
                 xatt_itemid = xapdoc.Keyword('itemid', att_itemid)
                 xpname = xapdoc.SortKey('pagename', pagename)
+                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or "Self")
                 xattachment = xapdoc.SortKey('attachment', att) # this is an attachment, store its filename
                 xmtime = xapdoc.SortKey('mtime', mtime)
                 xrev = xapdoc.SortKey('revision', '0')
--- a/MoinMoin/search/builtin.py	Sun Sep 03 02:34:18 2006 +0200
+++ b/MoinMoin/search/builtin.py	Sun Sep 03 03:30:03 2006 +0200
@@ -611,7 +611,8 @@
         
         @param page: the current page instance
         """
-        return self.query.search(page)
+        if page:
+            return self.query.search(page)
 
     def _getHits(self, pages, matchSearchFunction):
         """ Get the hit tuples in pages through matchSearchFunction """
@@ -645,7 +646,8 @@
                         page = Page(self.request, "%s/%s" % (fs_rootpage, attachment))
                         hits.append((wikiname, page, None, None))
                     else:
-                        hits.append((wikiname, page, attachment, None))
+                        matches = matchSearchFunction(page=None, uid=uid)
+                        hits.append((wikiname, page, attachment, matches))
                 else:
                     matches = matchSearchFunction(page=page, uid=uid)
                     if matches:
--- a/MoinMoin/search/results.py	Sun Sep 03 02:34:18 2006 +0200
+++ b/MoinMoin/search/results.py	Sun Sep 03 03:30:03 2006 +0200
@@ -194,12 +194,6 @@
     def weight(self, unique=1):
         return 1
 
-    def get_matches(self, unique=1, sort='start', type=Match):
-        return []
-
-    def _unique_matches(self, type=Match):
-        return []
-
 
 class FoundRemote(FoundPage):
     """ Represents an attachment in search results """
@@ -821,7 +815,7 @@
         if wikiname in (request.cfg.interwikiname, 'Self'): # a local match
             if attachment:
                 result_hits.append(FoundAttachment(page.page_name,
-                    attachment, page=page))
+                    attachment, page=page, matches=match))
             else:
                 result_hits.append(FoundPage(page.page_name, match, page))
         else: