Home

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
MethodputDocAdd a document to the index
MethodflushWrite documents to disk and break them into words
MethodremoveTake a document out of the database by reference, by uri or by id
Method__delitem__Undocumented
MethodupdateAttributesEdit a document's attributes in-place. Note: there is no way to edit
MethodoptimizePerform either a free-space compact operation, or a db optimization,
Method__len__Undocumented
Methodsync??? If anyone knows what this should do and how it is different from
MethodopenOpen the database directory. Only valid modes are 'a', 'r' and 'w'
MethodclosePut the database down for the night.
MethodsearchSubmit a query to the database and return the results object.
MethodwalkResultProduce a HHit for each doc in the result
Method__getitem__Undocumented
def __init__(self, autoflush=False):
Undocumented
def putDoc(self, doc, clean=False, weight=False):
Add a document to the index
def flush(self):
Write documents to disk and break them into words
@unicodeToByte((2, 'uri'), TypeError)
def remove(self, doc=None, uri=None, id=None):
Take a document out of the database by reference, by uri or by id
def __delitem__(self, uri):
Undocumented
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 __len__(self):
Undocumented
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
def close(self):
Put the database down for the night.
def search(self, condition):
Submit a query to the database and return the results object.
def walkResult(self, result):
Produce a HHit for each doc in the result
@unicodeToByte((1, 'uri'), KeyError)
def __getitem__(self, uri):
Undocumented
API Documentation for Hypy, generated by pydoctor at 2009-09-20 10:39:55.