Matt Chaput avatar Matt Chaput committed b5b6848

CoordMatcher was inheriting a generic implementation of _replacement() that expected the initializer to have a boost argument.
Overrode with a custom method.

Comments (0)

Files changed (1)

src/whoosh/matching/wrappers.py

     def term(self):
         return self._term
 
+    def replace(self, minquality=0):
+        return self
+
 
 class CoordMatcher(WrappingMatcher):
     """Modifies the computed score to penalize documents that don't match all
         self._maxqual = child.max_quality()
         self._scale = scale
 
+    def _replacement(self, newchild):
+        return self.__class__(newchild, scale=self._scale)
+
     def _sqr(self, score, matching):
         # This is the "SQR" (Short Query Ranking) function used by Apple's old
         # V-twin search library, described in the paper "V-Twin: A Lightweight
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.