Changeset 234 for branches/mbutscher/work/lib/whoosh/matching.py
- Timestamp:
- 01/09/11 19:37:51 (2 years ago)
- Files:
-
- 1 modified
-
branches/mbutscher/work/lib/whoosh/matching.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/mbutscher/work/lib/whoosh/matching.py
r231 r234 252 252 253 253 def __init__(self, ids, weights=None, values=None, format=None, 254 scorer=None, position=0 ):254 scorer=None, position=0, all_weights=None): 255 255 """ 256 256 :param ids: a list of doc IDs. … … 267 267 self._ids = ids 268 268 self._weights = weights 269 self._all_weights = all_weights 269 270 self._values = values 270 271 self._i = position … … 319 320 320 321 def weight(self): 321 if self._weights: 322 if self._all_weights: 323 return self._all_weights 324 elif self._weights: 322 325 return self._weights[self._i] 323 326 else: … … 1023 1026 child.skip_to(self._id) 1024 1027 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 1030 1036 child.next() 1031 1037 continue 1038 1039 break 1040 1032 1041 def id(self): 1033 1042 return self._id
