Matt Chaput  committed 646a065

Fixed ListMatcher.max_quality().

  • Participants
  • Parent commits c6115b2
  • Branches default

Comments (0)

Files changed (1)

File src/whoosh/matching/

     def replace(self, minquality=0):
-        if not self.is_active() or (minquality
-                                    and self.max_quality() < minquality):
+        if not self.is_active():
+            return NullMatcher()
+        elif minquality and self.max_quality() < minquality:
             return NullMatcher()
             return self
     def max_quality(self):
         # This matcher treats all postings in the list as one "block", so the
         # block quality is the same as the quality of the entire list
-        return self._scorer.block_quality(self)
+        if self._scorer:
+            return self._scorer.block_quality(self)
+        else:
+            return self.block_max_weight()
     def block_quality(self):
         return self._scorer.block_quality(self)