Commits

Matt Chaput committed 4e2672c

Fixed AndMaybe.quality() to check is_active() of the submatchers. See issue #124.

Comments (0)

Files changed (1)

src/whoosh/matching.py

         return skipped
     
     def quality(self):
-        if self.a.id() == self.b.id():
-            return self.a.quality() + self.b.quality()
-        else:
-            return self.a.quality()
+        q = 0.0
+        if self.a.is_active():
+            q += self.a.quality()
+            if b.is_active() and self.a.id() == self.b.id():
+                q += self.b.quality()
+        return q
     
     def weight(self):
         if self.a.id() == self.b.id():