#include <database.h>
Inheritance diagram for Xapian::Database:
Public Member Functions | |
void | add_database (const Database &database) |
Add an existing database (or group of databases) to those accessed by this object. | |
Database () | |
Create a Database with no databases in. | |
Database (const std::string &path) | |
Open a Database, automatically determining the database backend to use. | |
virtual | ~Database () |
Destroy this handle on the database. | |
Database (const Database &other) | |
Copying is allowed. | |
void | operator= (const Database &other) |
Assignment is allowed. | |
void | reopen () |
Re-open the database. | |
virtual std::string | get_description () const |
Introspection method. | |
PostingIterator | postlist_begin (const std::string &tname) const |
An iterator pointing to the start of the postlist for a given term. | |
PostingIterator | postlist_end (const std::string &) const |
Corresponding end iterator to postlist_begin(). | |
TermIterator | termlist_begin (Xapian::docid did) const |
An iterator pointing to the start of the termlist for a given document. | |
TermIterator | termlist_end (Xapian::docid) const |
Corresponding end iterator to termlist_begin(). | |
bool | has_positions () const |
Does this database have any positional information? | |
PositionIterator | positionlist_begin (Xapian::docid did, const std::string &tname) const |
An iterator pointing to the start of the position list for a given term in a given document. | |
PositionIterator | positionlist_end (Xapian::docid, const std::string &) const |
Corresponding end iterator to positionlist_begin(). | |
TermIterator | allterms_begin () const |
An iterator which runs across all terms in the database. | |
TermIterator | allterms_end () const |
Corresponding end iterator to allterms_begin(). | |
TermIterator | allterms_begin (const std::string &prefix) const |
An iterator which runs across all terms with a given prefix. | |
TermIterator | allterms_end (const std::string &) const |
Corresponding end iterator to allterms_begin(prefix). | |
Xapian::doccount | get_doccount () const |
Get the number of documents in the database. | |
Xapian::docid | get_lastdocid () const |
Get the highest document id which has been used in the database. | |
Xapian::doclength | get_avlength () const |
Get the average length of the documents in the database. | |
Xapian::doccount | get_termfreq (const std::string &tname) const |
Get the number of documents in the database indexed by a given term. | |
bool | term_exists (const std::string &tname) const |
Check if a given term exists in the database. | |
Xapian::termcount | get_collection_freq (const std::string &tname) const |
Return the total number of occurrences of the given term. | |
Xapian::doclength | get_doclength (Xapian::docid did) const |
Get the length of a document. | |
void | keep_alive () |
Send a "keep-alive" to remote databases to stop them timing out. | |
Xapian::Document | get_document (Xapian::docid did) const |
Get a document from the database, given its document id. |
For searching, this class is used in conjunction with an Enquire object.
InvalidArgumentError | will be thrown if an invalid argument is supplied, for example, an unknown database type. | |
DatabaseOpeningError | may be thrown if the database cannot be opened (for example, a required file cannot be found). | |
DatabaseVersionError | may be thrown if the database is in an unsupported format (for example, created by a newer version of Xapian which uses an incompatible format). |
|
Create a Database with no databases in.
|
|
Open a Database, automatically determining the database backend to use.
|
|
Destroy this handle on the database. If there are no copies of this object remaining, the database(s) 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.
|
|
An iterator which runs across all terms with a given prefix. This is functionally similar to getting an iterator with allterms_begin() and then calling skip_to(prefix) on that iterator to move to the start of the prefix, but is more convenient (because it detects the end of the prefixed terms), and may be more efficient than simply calling skip_to() after opening the iterator, particularly for network databases.
|
|
An iterator which runs across all terms in the database.
|
|
Corresponding end iterator to allterms_begin(prefix).
|
|
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 it indexes: ie, the sum of the within document frequencies of the term.
|
|
Introspection method.
Reimplemented in Xapian::WritableDatabase. |
|
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 a Xapian::Document object which provides the information about a document.
|
|
Get the highest document id which has been used in the database.
|
|
Get the number of documents in the database indexed by a given term.
|
|
Does this database have any positional information?
|
|
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. If the term name is the empty string, the iterator returned will list all the documents in the database. Such an iterator will always return a WDF value of 1, since there is no obvious meaning for this quantity in this case. |
|
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 a Xapian::DatabaseModifiedError. |
|
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().
|