changeset 4988:f23b2823af31

Xapian2009: Bug with "language:en" was fixed for the Moin search. Now language: behaves like described on the HelpOnSearching.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sun, 09 Aug 2009 13:34:12 +0200
parents 5812d5394811
children fddc77cbe7bf
files MoinMoin/search/queryparser.py
diffstat 1 files changed, 1 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/queryparser.py	Sun Aug 09 13:01:08 2009 +0200
+++ b/MoinMoin/search/queryparser.py	Sun Aug 09 13:34:12 2009 +0200
@@ -667,16 +667,8 @@
 
     def search(self, page):
         logging.debug("LanguageSearch searching page %r for (negated = %r) %r" % (page.page_name, self.negated, self._pattern))
-        match = False
-        body = page.getPageHeader()
 
-        comma = re.compile(',')
-        iterator = comma.finditer(self.pattern)
-        temp = 0
-        for m_obj in iterator:
-            if re.findall('#language %s' % self.pattern[temp:m_obj.end()-2], body):
-                match = True
-            temp = m_obj.end()
+        match = self.pattern == page.pi['language']
 
         # Decide what to do with the results.
         if self.negated: