Commits

Matt Chaput committed 4ec6592

Changes to support FunctionPlugin.

  • Participants
  • Parent commits dcae935

Comments (0)

Files changed (3)

src/whoosh/qparser/default.py

             # Try each tagger to see if it matches at the current position
             for tagger in taggers:
                 node = tagger.match(self, text, pos)
-                if node:
+                if node is not None:
                     if node.endchar <= pos:
                         raise Exception("Token %r did not move cursor forward."
                                         " (%r, %s)" % (tagger, text, pos))

src/whoosh/qparser/taggers.py

         match = self.expr.match(text, pos)
         if match:
             node = self.create(parser, match)
-            if node is None:
-                raise Exception("%s.match() did not return a node"
-                                % (self.__class__.__name__))
-            return node.set_range(match.start(), match.end())
+            if node is not None:
+                node = node.set_range(match.start(), match.end())
+                return node
 
     def create(self, parser, match):
         """When the regular expression matches, this method is called to
 
     def create(self, parser, match):
         return self.fn(**match.groupdict())
+
+
+
+
+
+

src/whoosh/query/terms.py

                     self.boost, self.maxdist, self.prefixlength)
 
     def __unicode__(self):
-        r = self.text + u("~")
+        r = u("%s:%s") % (self.fieldname, self.text) + u("~")
         if self.maxdist > 1:
             r += u("%d") % self.maxdist
         if self.boost != 1.0: