changeset 4746:3f426468f743

Fixed DeprecatedIsNotRespected regarding search ranking.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Fri, 03 Jul 2009 11:38:55 +0100
parents 0817780f35d4
children aa598735a74a
files MoinMoin/Page.py MoinMoin/search/results.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Tue May 12 12:35:29 2009 +0200
+++ b/MoinMoin/Page.py	Fri Jul 03 11:38:55 2009 +0100
@@ -1064,7 +1064,7 @@
         if 'deprecated' in pi:
             # deprecated page, append last backup version to current contents
             # (which should be a short reason why the page is deprecated)
-            request.theme.add_msg(_('The backed up content of this page is deprecated and will not be included in search results!'), "warning")
+            request.theme.add_msg(_('The backed up content of this page is deprecated and will ranked lower in search results!'), "warning")
 
             revisions = self.getRevList()
             if len(revisions) >= 2: # XXX shouldn't that be ever the case!? Looks like not.
--- a/MoinMoin/search/results.py	Tue May 12 12:35:29 2009 +0200
+++ b/MoinMoin/search/results.py	Fri Jul 03 11:38:55 2009 +0100
@@ -118,6 +118,8 @@
             weight += match.weight()
             # More sophisticated things to be added, like increase
             # weight of near matches.
+        if self.page.parse_processing_instructions().get('deprecated', False):
+            weight = int(weight / 4) # rank it down
         return weight
 
     def add_matches(self, matches):