Manage Xapian databases.
Force a flush after flush_timeout seconds since the last change to the database. Needs to be overridden in chile classes.
Force a flush every flush_threshold changes to the database. Needs to be overridden in chile classes
Property objects collected for a class inherited from the Database
Xapian database name.
Close the database.
Create new document.
Parameters: | props – document properties |
---|---|
Returns: | GUID of newly created document |
Update properties of existing document.
Parameters: |
|
---|
Delete document.
Props guid: | document GUID to delete |
---|
Search documents.
The result will be an array of dictionaries with found documents’ properties.
Parameters: |
|
---|---|
Returns: | a tuple of (entries, total_count); where the total_count is the total number of documents conforming the search parameters, i.e., not only documents that are included to the resulting list |
Scan for a document.
This function will be called from internals when database needs to be populated. If function returns a found document, it will be called once more until it fails.
Returns: | None if there no documents; a tuple of (guid, properties) for found document |
---|
Collect inforamtion about document property.
Parameters: |
|
---|
Property name.
Xapian document’s slot number to add property value to.
Xapian serach term prefix, if None, property is not a term.
Xapian will use boolean search for this property.
Default property value or None.
If property value contains several values, list them all.