#include <omdatabase.h>
Inheritance diagram for OmDatabase:
Public Methods | |
void | add_database (const OmDatabase &database) |
Add an existing database (or group of databases) to those accessed by this object. More... | |
OmDatabase () | |
Create an OmDatabase with no databases in. More... | |
OmDatabase (OmDatabase::Internal *internal) | |
virtual | ~OmDatabase () |
Destroy this handle on the database. More... | |
OmDatabase (const OmDatabase &other) | |
Copying is allowed. More... | |
virtual void | operator= (const OmDatabase &other) |
Assignment is allowed. More... | |
void | reopen () |
Re-open the database. More... | |
virtual std::string | get_description () const |
Introspection method. More... | |
OmPostListIterator | postlist_begin (const om_termname &tname) const |
An iterator pointing to the start of the postlist for a given term. More... | |
OmPostListIterator | postlist_end (const om_termname &tname) const |
Corresponding end iterator to postlist_begin(). More... | |
OmTermIterator | termlist_begin (om_docid did) const |
An iterator pointing to the start of the termlist for a given document. More... | |
OmTermIterator | termlist_end (om_docid did) const |
Corresponding end iterator to termlist_begin(). More... | |
OmPositionListIterator | positionlist_begin (om_docid did, const om_termname &tname) const |
An iterator pointing to the start of the position list for a given term in a given document. More... | |
OmPositionListIterator | positionlist_end (om_docid did, const om_termname &tname) const |
Corresponding end iterator to positionlist_begin(). More... | |
OmTermIterator | allterms_begin () const |
An iterator which runs across all terms in the database. More... | |
OmTermIterator | allterms_end () const |
Corresponding end iterator to allterms_begin(). More... | |
om_doccount | get_doccount () const |
Get the number of documents in the database. More... | |
om_doclength | get_avlength () const |
Get the average length of the documents in the database. More... | |
om_doccount | get_termfreq (const om_termname &tname) const |
Get the number of documents in the database indexed by a given term. More... | |
bool | term_exists (const om_termname &tname) const |
Check if a given term exists in the database. More... | |
om_termcount | get_collection_freq (const om_termname &tname) const |
Return the total number of occurrences of the given term. More... | |
om_doclength | get_doclength (om_docid did) const |
Get the length of a document. More... | |
void | keep_alive () |
Send a "keep-alive" to remote databases to stop them timing out. More... | |
OmDocument | get_document (om_docid did) const |
Get a document from the database, given its document id. More... | |
Public Attributes | |
Internal * | internal |
This class is used in conjunction with an OmEnquire object.
OmInvalidArgumentError | will be thrown if an invalid argument is supplied, for example, an unknown database type. |
OmOpeningError | may be thrown if the database cannot be opened (for example, a required file cannot be found). |
|
Create an OmDatabase with no databases in.
|
|
Destroy this handle on the database. If there are no copies of this object remaining, the database will be closed. |
|
Copying is allowed. The internals are reference counted, so copying is cheap. |
|
Add an existing database (or group of databases) to those accessed by this object. The handle(s) of the database(s) will be copied, so may be deleted or reused by the caller as desired.
|
|
An iterator which runs across all terms in the database.
|
|
Corresponding end iterator to allterms_begin().
|
|
Get the average length of the documents in the database.
|
|
Return the total number of occurrences of the given term. This is the sum of the number of ocurrences of the term in each document: ie, the sum of the within document frequencies of the term.
|
|
Introspection method.
Reimplemented in OmWritableDatabase. |
|
Get the number of documents in the database.
|
|
Get the length of a document.
|
|
Get a document from the database, given its document id. This method returns an OmDocument object which provides the information about a document.
|
|
Get the number of documents in the database indexed by a given term.
|
|
Send a "keep-alive" to remote databases to stop them timing out.
|
|
Assignment is allowed. The internals are reference counted, so assignment is cheap. |
|
An iterator pointing to the start of the position list for a given term in a given document.
|
|
Corresponding end iterator to positionlist_begin().
|
|
An iterator pointing to the start of the postlist for a given term.
|
|
Corresponding end iterator to postlist_begin().
|
|
Re-open the database. This re-opens the database(s) to the latest available version(s). It can be used either to make sure the latest results are returned, or to recover from an OmDatabaseModifiedError. |
|
Check if a given term exists in the database. Return true if and only if the term exists in the database. This is the same as (get_termfreq(tname) != 0), but will often be more efficient. |
|
An iterator pointing to the start of the termlist for a given document.
|
|
Corresponding end iterator to termlist_begin().
|