FunctionWeighting.FunctionScorer not implement max_quality method

Issue #435 new
fyrestone NA
created an issue

whoosh version 2.7.2 Sample code:

def pos_score_fn(searcher, fieldname, text, matcher):
    poses = matcher.value_as("positions")
    return 1.0 / (poses[0] + 1)

pos_weighting = FunctionWeighting(pos_score_fn)
results = ss.search(q, limit=5) 

Some search queries will raise the following traceback:

    results = ss.search(q, limit=5)
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\searching.py", line 819, in search_with_collector
    collector.run()
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\collectors.py", line 144, in run
    self.collect_matches()
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\collectors.py", line 214, in collect_matches
    for sub_docnum in self.matches():
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\collectors.py", line 392, in matches
    self.matcher = matcher = matcher.replace(minscore or 0)
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\matching\binary.py", line 438, in replace
    a_max = a.max_quality()
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\matching\mcore.py", line 616, in max_quality
    return self.scorer.max_quality()
  File "D:\Python27\python-2.7.10\lib\site-packages\whoosh\scoring.py", line 119, in max_quality
    raise NotImplementedError(self.__class__.__name__)
NotImplementedError: FunctionScorer

Comments (1)

  1. Log in to comment