Ticket #33: hype_scores.patch

File hype_scores.patch, 0.8 kB (added by Alberto Valverde, 2 years ago)
  • pyndexter/hyperestraier.py

    old new  
    109109 
    110110 
    111111class HyperestraierSearch(Search): 
     112    def __init__(self, indexer, phrase, context): 
     113        self.indexer = indexer 
     114        self.phrase = phrase 
     115        self.context = context.scores().option(hype.ESTCONDSCFB) 
     116 
    112117    def __iter__(self): 
    113         for doc in self.context: 
    114             # How do we get the score? 
    115             yield Hit(document=self.indexer.fetch, 
     118        for doc, score in self.context: 
     119            yield Hit(document=self.indexer.fetch, score=score, 
    116120                      **self.indexer._translate_attributes(doc)) 
    117121 
    118122    def __len__(self):