|
|
Cheshire3 Objects: Database |
A Database is a collection of Records and Indexes. It is responsable for maintaining and allowing access to its components, as well as metadata associated with the collections. It must be able to interpret a request, splitting it amongst its known resources and then recombine the values into a single response.
Note: The Database API is still under review, but likely to remain as is
| Function | Parameters | Returns | Description |
|---|---|---|---|
| __init__ | domNode, parentObject | The constructer takes a DOM tree containing the configuration of the database and the object which the database should consider as its parent, normally a Server. | |
| begin_indexing | session | Perform any routines required before indexing records. e.g. discover configured indexes, initialize necessary files. | |
| commit_indexing | session | Perform any routines needed to complete indexing. e.g. collate temporary index files, commit finished indexes to disk. | |
| add_record | session, record | Function to call to ensure that a record is registered with the database. This will only do the registration, you have to call index_record to index it. | |
| index_record | session, record | Sends the record to all known indexes to process | |
| unindex_record | session, record | Remove references to the record from all known indexes. Does not delete the record from the recordStore. | |
| remove_record | session, record | Remove the record from the database's register. This will only unregister the record, you have to call unindex_record to remove pointers from indexes. | |
| scan | session, query, numberOfTerms, direction | list of term summaries | Given a query, resolve the index and return the raw information from it. Each item in the list returned consists of the term it represents (as a string), followed by a sequence of 3 integers: term id, number of matching records, total number of occurences. |
| search | session, query | resultSet | Given a query, process it and return a resultSet |
| sort | session, resultSets, sortKeys | resultSet | Merge the given sets and sort by the keys, returning a new resultSet |
| authenticate | session | Authenticate user with database. |