Matt Chaput  committed 66704ae

Removed erroneous KeyError from TopCollector.remove().
Fixes issue #356.

  • Participants
  • Parent commits d9368c8

Comments (0)

Files changed (1)

File src/whoosh/

         negated = 0 - global_docnum
         items = self.items
-        # Search through the results for the document and remove it
+        # Remove the document if it's on the list (it may not be since
+        # TopCollector forgets documents that don't make the top N list)
         for i in xrange(len(items)):
             if items[i][1] == negated:
                 self.minscore = items[0][0] if items else 0
-        # The document wasn't on the list... somebody's confused!
-        raise KeyError(global_docnum)
     def results(self):
         # The items are stored (postive score, negative docnum) so the heap
         # keeps the highest scores and lowest docnums, in order from lowest to