Changeset 362
- Timestamp:
- 01/14/07 18:05:18 (2 years ago)
- Files:
-
- pyndexter/branches/refactoring/pyndexter/indexers/default.py (modified) (2 diffs)
- pyndexter/branches/refactoring/pyndexter/indexers/lupy.py (modified) (1 diff)
- pyndexter/branches/refactoring/pyndexter/__init__.py (modified) (8 diffs)
- pyndexter/branches/refactoring/pyndexter/sources/file.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyndexter/branches/refactoring/pyndexter/indexers/default.py
r361 r362 135 135 else: 136 136 self.words[word] = set([document.uri]) 137 137 138 138 # Update attributes 139 139 self.attributes[document.uri] = deepcopy(document.attributes) … … 147 147 self.uris.sync() 148 148 self.attributes.sync() 149 149 150 150 index = synchronised(index) 151 151 pyndexter/branches/refactoring/pyndexter/indexers/lupy.py
r361 r362 17 17 hits = list(self.db.findInField(uri=uri)) 18 18 print hits 19 19 20 20 def index(self, document): 21 21 attributes = dict([('_' + k.encode('utf-8'), str(v)) pyndexter/branches/refactoring/pyndexter/__init__.py
r361 r362 97 97 """ A Document represents an indexable object in pyndexter. All string 98 98 attributes must be unicode, including the content. 99 99 100 100 content:: is optional, and if not provided will be fetched from the 101 101 `source`. If it is a callable, it will be called to fetch the content, … … 105 105 documents lifetime. Typically a timestamp, but could be a revision number, 106 106 etc. 107 107 108 108 source:: is the Source object where this documents content can be lazily 109 109 fetched from. """ … … 145 145 only fetching documents and iterating over them, but for determining what 146 146 has changed in the source. 147 147 148 148 Determing what has changed is achieved with the state() and difference() 149 149 methods. The ''state'' of a source is the minimum information required to … … 279 279 text += ")" 280 280 return text 281 return show(self) 281 return show(self) 282 282 283 283 … … 293 293 -<term> exclude documents containing this term 294 294 <term> or <term> return documents matching either term 295 295 296 296 eg. 297 297 … … 373 373 def close(self): 374 374 """ Close the indexer. The object is subsequently not usable. 375 375 376 376 `sync()` is automatically called by the `Framework` prior to `close()`.""" 377 377 raise NotImplementedError … … 400 400 def sync(self): 401 401 """ Synchronise indexer with stored representation. """ 402 402 403 403 404 404 class Framework(object): … … 483 483 484 484 `query` is a pyndexter compatible search string. 485 485 486 486 Returns a `Search` object. """ 487 487 query = Query(query) pyndexter/branches/refactoring/pyndexter/sources/file.py
r361 r362 49 49 path.startswith(self.root) and \ 50 50 self.predicate(path) 51 51 52 52 53 53 def fetch(self, uri):
