ZeroDivisionError in search

Issue #490 new
Michal Čihař
created an issue
ZeroDivisionError: division by zero
  File "whoosh/searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "whoosh/searching.py", line 819, in search_with_collector
    collector.run()
  File "whoosh/collectors.py", line 144, in run
    self.collect_matches()
  File "whoosh/collectors.py", line 743, in collect_matches
    child.collect(sub_docnum)
  File "whoosh/collectors.py", line 369, in collect
    score = self.matcher.score()
  File "whoosh/matching/wrappers.py", line 571, in score
    return self._sqr(score, matching)
  File "whoosh/matching/wrappers.py", line 554, in _sqr
    ((termcount - 1) / termcount))

The problematic variable being termcount = 0

Comments (2)

  1. Michal Čihař reporter

    The root cause being that Term.matcher() returned NullMatcher for some reason. Unfortunately I can't reproduce the issue right now to know why it did so. Still the matcher should deal with this situation gracefully.

  2. Log in to comment