Class h.l.HDatabase(object):
Part of hypy.libView In Hierarchy
A more pythonic interface to estraier's database With autoflush=True (the default), automatically flush after every document add, which simplifies indexing. Set autoflush=False to manually flush, which allows better performance when indexing lots of documents at once. Per http://hyperestraier.sourceforge.net/uguide-en.html Hyper Estraier expects data to be stored as utf-8 bytes. Therefore, there is no encoding parameter.
| Method | __init__ | Undocumented |
| Method | putDoc | Add a document to the index |
| Method | flush | Write documents to disk and break them into words |
| Method | remove | Take a document out of the database by reference, by uri or by id |
| Method | __delitem__ | Undocumented |
| Method | updateAttributes | Edit a document's attributes in-place. Note: there is no way to edit |
| Method | optimize | Perform either a free-space compact operation, or a db optimization, |
| Method | __len__ | Undocumented |
| Method | sync | ??? If anyone knows what this should do and how it is different from |
| Method | open | Open the database directory. Only valid modes are 'a', 'r' and 'w' |
| Method | close | Put the database down for the night. |
| Method | search | Submit a query to the database and return the results object. |
| Method | walkResult | Produce a HHit for each doc in the result |
| Method | __getitem__ | Undocumented |
@unicodeToByte((2, 'uri'), TypeError)
def remove(self, doc=None, uri=None, id=None):
def remove(self, doc=None, uri=None, id=None):
Take a document out of the database by reference, by uri or by id
def
updateAttributes(self, doc):
Edit a document's attributes in-place. Note: there is no way to edit the texts.
def
optimize(self, purge=False, opt=False):
Perform either a free-space compact operation, or a db optimization, or both, or neither, depending on flags.
def
sync(self):
??? If anyone knows what this should do and how it is different from flush(), tell me.
def
open(self, directory, mode):
Open the database directory. Only valid modes are 'a', 'r' and 'w' 'a' corresponds to WRITER | CREAT (created only if it does not exist) 'w' corresponds to WRITER | CREAT | TRUNC (clobbered if it exists) 'r' corresponds to READER