Show
Ignore:
Timestamp:
30/04/06 14:09:58 (4 years ago)
Author:
athomas
Message:

pyndexter:

  • Added a horribly inefficient built-in indexer, default.DefaultIndexer. There seems to be a memory leak somewhere, so on large datasets the indexer will consume large amounts of memory.
  • Added a util module with CacheDict, currently used by the default indexer.
  • Added some more CAP_ bits.
  • Source state data is now accumulated by the Source classes __iter__() method, no longer requiring a full walk of the source to collect state. This means an Indexer.update() will automagically do the right thing.
  • Factored out some common environment initialisation code into Indexer._init_env().
  • Factored FileSource include/exclude/predicate code into base Source class so it can be reused.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pyndexter/trunk/pyndexter/hyperestraier.py

    r331 r332  
    55class HyperestraierIndexer(Indexer): 
    66    capabilities = CAP_READONLY | CAP_CONTENT | CAP_ATTRIBUTES | CAP_ORDERING |\ 
    7                    CAP_HITCOUNT | CAP_LIST | CAP_RELEVANCE 
     7                   CAP_HITCOUNT | CAP_LIST | CAP_RELEVANCE | CAP_WHOLEWORD | \ 
     8                   CAP_ASTERISK | CAP_INTERSECTION 
    89 
    910    def __init__(self, path, source=None, mode=READWRITE, hype_mode=None): 
    1011        Indexer.__init__(self, source, mode, os.path.join(path, 'state.db')) 
    1112        self.path = path 
    12         if not os.path.exists(self.path): 
    13             if mode != READWRITE: 
    14                 raise IndexerError("Index directory has not been initialised") 
    15             os.makedirs(self.path) 
     13        self._init_env(self.path) 
    1614        self.hype_path = os.path.join(self.path, 'hyperestraier.db') 
    1715        if hype_mode is None: 
     
    6058            else: 
    6159                order_type = 'STR' 
    62             print order_ascending 
    6360            order = u'@%s %s%s' % (order_by, order_type, 
    6461                                   order_ascending and 'A' or 'D')