Show
Ignore:
Timestamp:
01/09/11 19:37:51 (2 years ago)
Author:
mbutscher
Message:

branches/stable-2.0:
* Bug fixed: Windows: "Invalid handle" error on

command line bridge insertion plugins

branches/mbutscher/work:
* Write last writing program version into wiki db
* Several bug fixes with whoosh (index search)
* Index search: Highlight found terms and jump to

one found term on double-click

* Bug fixed: Windows: "Invalid handle" error on

command line bridge insertion plugins

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/mbutscher/work/lib/whoosh/matching.py

    r231 r234  
    252252     
    253253    def __init__(self, ids, weights=None, values=None, format=None, 
    254                  scorer=None, position=0): 
     254                 scorer=None, position=0, all_weights=None): 
    255255        """ 
    256256        :param ids: a list of doc IDs. 
     
    267267        self._ids = ids 
    268268        self._weights = weights 
     269        self._all_weights = all_weights 
    269270        self._values = values 
    270271        self._i = position 
     
    319320     
    320321    def weight(self): 
    321         if self._weights: 
     322        if self._all_weights: 
     323            return self._all_weights 
     324        elif self._weights: 
    322325            return self._weights[self._i] 
    323326        else: 
     
    10231026            child.skip_to(self._id) 
    10241027         
    1025         while (self._id < self.limit 
    1026                and ((child.is_active() and self._id == child.id()) 
    1027                     or missing(self._id))): 
    1028             self._id += 1 
    1029             if child.is_active(): 
     1028        # While self._id is missing or is in the child matcher, increase it 
     1029        while child.is_active() and self._id < self.limit: 
     1030            if missing(self._id): 
     1031                self._id += 1 
     1032                continue 
     1033 
     1034            if self._id == child.id(): 
     1035                self._id += 1 
    10301036                child.next() 
    1031      
     1037                continue 
     1038             
     1039            break 
     1040         
    10321041    def id(self): 
    10331042        return self._id