#include <database.h>


Classes | |
| class | Internal |
| Base class for databases. More... | |
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 void | close () |
| Close the database. | |
| virtual std::string | get_description () const |
| Return a string describing this object. | |
| 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::doccount | get_value_freq (Xapian::valueno slot) const |
| Return the frequency of a given value slot. | |
| std::string | get_value_lower_bound (Xapian::valueno slot) const |
| Get a lower bound on the values stored in the given value slot. | |
| std::string | get_value_upper_bound (Xapian::valueno slot) const |
| Get an upper bound on the values stored in the given value slot. | |
| Xapian::termcount | get_doclength_lower_bound () const |
| Get a lower bound on the length of a document in this DB. | |
| Xapian::termcount | get_doclength_upper_bound () const |
| Get an upper bound on the length of a document in this DB. | |
| Xapian::termcount | get_wdf_upper_bound (const std::string &term) const |
| Get an upper bound on the wdf of term term. | |
| ValueIterator | valuestream_begin (Xapian::valueno slot) const |
| Return an iterator over the value in slot slot for each document. | |
| ValueIteratorEnd_ | valuestream_end (Xapian::valueno) const |
| Return end iterator corresponding to valuestream_begin(). | |
| Xapian::termcount | 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. | |
| std::string | get_spelling_suggestion (const std::string &word, unsigned max_edit_distance=2) const |
| Suggest a spelling correction. | |
| Xapian::TermIterator | spellings_begin () const |
| An iterator which returns all the spelling correction targets. | |
| Xapian::TermIterator | spellings_end () const |
| Corresponding end iterator to spellings_begin(). | |
| Xapian::TermIterator | synonyms_begin (const std::string &term) const |
| An iterator which returns all the synonyms for a given term. | |
| Xapian::TermIterator | synonyms_end (const std::string &) const |
| Corresponding end iterator to synonyms_begin(term). | |
| Xapian::TermIterator | synonym_keys_begin (const std::string &prefix=std::string()) const |
| An iterator which returns all terms which have synonyms. | |
| Xapian::TermIterator | synonym_keys_end (const std::string &=std::string()) const |
| Corresponding end iterator to synonym_keys_begin(prefix). | |
| std::string | get_metadata (const std::string &key) const |
| Get the user-specified metadata associated with a given key. | |
| Xapian::TermIterator | metadata_keys_begin (const std::string &prefix=std::string()) const |
| An iterator which returns all user-specified metadata keys. | |
| Xapian::TermIterator | metadata_keys_end (const std::string &=std::string()) const |
| Corresponding end iterator to metadata_keys_begin(). | |
| std::string | get_uuid () const |
| Get a UUID for the database. | |
Private Member Functions | |
| Document::Internal * | get_document_lazily (Xapian::docid did) const |
| Database (Internal *internal) | |
Private Attributes | |
| std::vector < Xapian::Internal::RefCntPtr < Internal > > | internal |
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). |
Definition at line 56 of file database.h.
| Xapian::Database::Database | ( | ) |
Create a Database with no databases in.
Definition at line 67 of file omdatabase.cc.
References LOGCALL_CTOR.
| Xapian::Database::Database | ( | const std::string & | path | ) | [explicit] |
Open a Database, automatically determining the database backend to use.
| path | directory that the database is stored in. |
Definition at line 347 of file dbfactory.cc.
References file_exists(), LOGCALL_CTOR, Xapian::open_stub(), rare, S_ISDIR, S_ISREG, and stat().
| Xapian::Database::Database | ( | Database::Internal * | internal_ | ) | [explicit, private] |
For internal use only.
Create a Database from its internals.
Definition at line 72 of file omdatabase.cc.
References LOGCALL_CTOR.
| Xapian::Database::~Database | ( | ) | [virtual] |
Destroy this handle on the database.
If there are no copies of this object remaining, the database(s) will be closed.
Definition at line 92 of file omdatabase.cc.
References LOGCALL_DTOR.
| Xapian::Database::Database | ( | const Database & | other | ) |
Copying is allowed.
The internals are reference counted, so copying is cheap.
| other | The object to copy. |
Definition at line 79 of file omdatabase.cc.
References internal, and LOGCALL_CTOR.
| void Xapian::Database::add_database | ( | const Database & | database | ) |
Add an existing database (or group of databases) to those accessed by this object.
| database | the database(s) to add. |
Definition at line 118 of file omdatabase.cc.
References internal, LOGCALL_VOID, and LOGLINE.
Referenced by DEFINE_TESTCASE(), main(), Xapian::open_stub(), and test_qp_spell2().
| TermIterator Xapian::Database::allterms_begin | ( | const std::string & | prefix | ) | const |
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 remote databases.
| prefix | The prefix to restrict the returned terms to. |
Definition at line 199 of file omdatabase.cc.
| TermIterator Xapian::Database::allterms_begin | ( | ) | const |
An iterator which runs across all terms in the database.
Definition at line 193 of file omdatabase.cc.
Referenced by Term::as_partial_query(), Term::as_wildcarded_query(), check_equal_dbs(), check_sparse_uid_terms(), dbcheck(), DEFINE_TESTCASE(), RemoteServer::msg_allterms(), closedb1_iterators::perform(), show_db_stats(), and show_termlist().
| TermIterator Xapian::Database::allterms_end | ( | const std::string & | ) | const [inline] |
| TermIterator Xapian::Database::allterms_end | ( | ) | const [inline] |
Corresponding end iterator to allterms_begin().
Definition at line 223 of file database.h.
Referenced by Term::as_partial_query(), Term::as_wildcarded_query(), check_equal_dbs(), check_sparse_uid_terms(), dbcheck(), DEFINE_TESTCASE(), RemoteServer::msg_allterms(), show_db_stats(), and show_termlist().
| void Xapian::Database::close | ( | ) | [virtual] |
Close the database.
This closes the database and closes all its file handles.
For a WritableDatabase, if a transaction is active it will be aborted, while if no transaction is active commit() will be implicitly called. Also the write lock is released.
Closing a database cannot be undone - in particular, calling reopen() after close() will not reopen it, but will instead throw a Xapian::DatabaseError exception.
Calling close() again on a database which has already been closed has no effect (and doesn't raise an exception).
After close() has been called, calls to other methods of the database, and to methods of other objects associated with the database, will either:
The reason for this behaviour is that otherwise we'd have to check that the database is still open on every method call on every object associated with a Database, when in many cases they are working on data which has already been loaded and so they are able to just behave correctly.
This method was added in Xapian 1.1.0.
Definition at line 108 of file omdatabase.cc.
References LOGCALL_VOID.
Referenced by DEFINE_TESTCASE().
| Xapian::doclength Xapian::Database::get_avlength | ( | ) | const |
Get the average length of the documents in the database.
Definition at line 269 of file omdatabase.cc.
References LOGCALL, LOGLINE, and RETURN.
Referenced by dbcheck(), dbstats_to_string(), DEFINE_TESTCASE(), CheckStatsWeight::get_sumpart(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| Xapian::termcount Xapian::Database::get_collection_freq | ( | const std::string & | tname | ) | const |
Return the total number of occurrences of the given term.
This is the sum of the number of occurrences of the term in each document it indexes: i.e., the sum of the within document frequencies of the term.
| tname | The term whose collection frequency is being requested. |
Definition at line 303 of file omdatabase.cc.
References get_doccount(), LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), RemoteServer::msg_collfreq(), RemoteServer::msg_postlist(), closedb1_iterators::perform(), termstats_to_string(), test_emptyterm1_helper(), and test_emptyterm2_helper().
| string Xapian::Database::get_description | ( | ) | const [virtual] |
Return a string describing this object.
Reimplemented in Xapian::WritableDatabase.
Definition at line 489 of file omdatabase.cc.
Referenced by DEFINE_TESTCASE(), and Xapian::Enquire::Internal::get_description().
| Xapian::doccount Xapian::Database::get_doccount | ( | ) | const |
Get the number of documents in the database.
Definition at line 243 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by Xapian::Compactor::Internal::add_source(), check_equal_dbs(), check_vals(), dbcheck(), dbstats_to_string(), DEFINE_TESTCASE(), get_collection_freq(), Xapian::Enquire::Internal::get_mset(), CheckStatsWeight::get_sumpart(), get_termfreq(), MyDontAskWeightPostingSource::init(), Xapian::FixedWeightPostingSource::init(), Xapian::ValuePostingSource::init(), Xapian::DecreasingValueWeightPostingSource::init(), main(), RemoteServer::msg_update(), MultiTermList::MultiTermList(), RemoteServer::RemoteServer(), show_db_stats(), term_exists(), test_emptyterm1_helper(), and test_emptyterm2_helper().
| Xapian::termcount Xapian::Database::get_doclength | ( | Xapian::docid | did | ) | const |
Get the length of a document.
Definition at line 418 of file omdatabase.cc.
References docid_zero_invalid(), LOGCALL, no_subdatabases(), rare, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), docstats_to_string(), MultiPostList::get_doclength(), RemoteServer::msg_doclength(), RemoteServer::msg_termlist(), and closedb1_iterators::perform().
| Xapian::termcount Xapian::Database::get_doclength_lower_bound | ( | ) | const |
Get a lower bound on the length of a document in this DB.
This bound does not include any zero-length documents.
Definition at line 362 of file omdatabase.cc.
References LOGCALL, rare, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), Xapian::Weight::init_(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| Xapian::termcount Xapian::Database::get_doclength_upper_bound | ( | ) | const |
Get an upper bound on the length of a document in this DB.
Definition at line 379 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), Xapian::Weight::init_(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| Document Xapian::Database::get_document | ( | Xapian::docid | did | ) | const |
Get a document from the database, given its document id.
This method returns a Xapian::Document object which provides the information about a document.
| did | The document id of the document to retrieve. |
| Xapian::DocNotFoundError | The document specified could not be found in the database. | |
| Xapian::InvalidArgumentError | did was 0, which is not a valid document id. |
Definition at line 433 of file omdatabase.cc.
References docid_zero_invalid(), LOGCALL, no_subdatabases(), rare, and RETURN.
Referenced by check_vals(), dbcheck(), DEFINE_TESTCASE(), main(), make_orcheck_db(), RemoteServer::msg_document(), closedb1_iterators::perform(), show_docdata(), show_value(), and show_values().
| Document::Internal * Xapian::Database::get_document_lazily | ( | Xapian::docid | did | ) | const [private] |
For internal use only.
Get a document from the database, but doesn't need to check if it exists.
This method returns a Xapian::Document object which provides the information about a document. If the document doesn't exist, either a NULL pointer may be returned, or the returned object will throw DocNotFoundError when you try to access it.
The caller should delete the returned object when it has finished with it.
| did | The document id of the document to retrieve. |
Definition at line 450 of file omdatabase.cc.
References Assert, docid_zero_invalid(), LOGCALL, and RETURN.
Referenced by SlowValueList::check(), ValueStreamDocument::do_get_data(), ValueStreamDocument::do_get_value(), and SlowValueList::next().
| Xapian::docid Xapian::Database::get_lastdocid | ( | ) | const |
Get the highest document id which has been used in the database.
Definition at line 255 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by Xapian::Compactor::Internal::add_source(), check_equal_dbs(), check_vals(), dbcheck(), dbstats_to_string(), DEFINE_TESTCASE(), MyDontAskWeightPostingSource::init(), main(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| string Xapian::Database::get_metadata | ( | const std::string & | key | ) | const |
Get the user-specified metadata associated with a given key.
User-specified metadata allows you to store arbitrary information in the form of (key,tag) pairs. See WritableDatabase::set_metadata() for more information.
When invoked on a Xapian::Database object representing multiple databases, currently only the metadata for the first is considered but this behaviour may change in the future.
If there is no piece of metadata associated with the specified key, an empty string is returned (this applies even for backends which don't support metadata).
Empty keys are not valid, and specifying one will cause an exception.
| key | The key of the metadata item to access. |
| Xapian::InvalidArgumentError | will be thrown if the key supplied is empty. |
Definition at line 705 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), main(), and RemoteServer::msg_getmetadata().
| string Xapian::Database::get_spelling_suggestion | ( | const std::string & | word, | |
| unsigned | max_edit_distance = 2 | |||
| ) | const |
Suggest a spelling correction.
| word | The potentially misspelled word. | |
| max_edit_distance | Only consider words which are at most max_edit_distance edits from word. An edit is a character insertion, deletion, or the transposition of two adjacent characters (default is 2). |
Definition at line 535 of file omdatabase.cc.
References edit_distance_unsigned(), Xapian::freq_edit_lower_bound(), LOGCALL, LOGLINE, RETURN, and TRIGRAM_SCORE_THRESHOLD.
Referenced by DEFINE_TESTCASE(), and test_tg_spell1().
| Xapian::doccount Xapian::Database::get_termfreq | ( | const std::string & | tname | ) | const |
Get the number of documents in the database indexed by a given term.
Definition at line 289 of file omdatabase.cc.
References get_doccount(), LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), CheckStatsWeight::get_sumpart(), Xapian::Enquire::Internal::get_termfreq(), Xapian::Internal::ExpandWeight::get_weight(), RemoteServer::msg_postlist(), RemoteServer::msg_termfreq(), closedb1_iterators::perform(), termstats_to_string(), test_emptyterm1_helper(), and test_emptyterm2_helper().
| std::string Xapian::Database::get_uuid | ( | ) | const |
Get a UUID for the database.
The UUID will persist for the lifetime of the database.
Replicas (eg, made with the replication protocol, or by copying all the database files) will have the same UUID. However, copies (made with copydatabase, or xapian-compact) will have different UUIDs.
If the backend does not support UUIDs or this database has no subdatabases, the UUID will be empty.
If this database has multiple sub-databases, the UUID string will contain the UUIDs of all the sub-databases.
Definition at line 723 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by check_equal_dbs(), DEFINE_TESTCASE(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| Xapian::doccount Xapian::Database::get_value_freq | ( | Xapian::valueno | slot | ) | const |
Return the frequency of a given value slot.
This is the number of documents which have a (non-empty) value stored in the slot.
| slot | The value slot to examine. |
| UnimplementedError | The frequency of the value isn't available for this database type. |
Definition at line 317 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), Xapian::ValuePostingSource::init(), RemoteServer::msg_valuestats(), and closedb1_iterators::perform().
| string Xapian::Database::get_value_lower_bound | ( | Xapian::valueno | slot | ) | const |
Get a lower bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
If the lower bound isn't available for the given database type, this will return the lowest possible bound - the empty string.
| slot | The value slot to examine. |
Definition at line 330 of file omdatabase.cc.
References LOGCALL, rare, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), RemoteServer::msg_valuestats(), and closedb1_iterators::perform().
| std::string Xapian::Database::get_value_upper_bound | ( | Xapian::valueno | slot | ) | const |
Get an upper bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
| slot | The value slot to examine. |
| UnimplementedError | The upper bound of the values isn't available for this database type. |
Definition at line 347 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), Xapian::ValueWeightPostingSource::init(), RemoteServer::msg_valuestats(), and closedb1_iterators::perform().
| Xapian::termcount Xapian::Database::get_wdf_upper_bound | ( | const std::string & | term | ) | const |
Get an upper bound on the wdf of term term.
Definition at line 393 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), and Xapian::Weight::init_().
| bool Xapian::Database::has_positions | ( | ) | const |
Does this database have any positional information?
Definition at line 214 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), RemoteServer::msg_update(), RemoteServer::RemoteServer(), and show_db_stats().
| void Xapian::Database::keep_alive | ( | ) |
Send a "keep-alive" to remote databases to stop them timing out.
Has no effect on non-remote databases.
Definition at line 479 of file omdatabase.cc.
References LOGCALL_VOID.
Referenced by DEFINE_TESTCASE(), and RemoteServer::msg_keepalive().
| Xapian::TermIterator Xapian::Database::metadata_keys_begin | ( | const std::string & | prefix = std::string() |
) | const |
An iterator which returns all user-specified metadata keys.
When invoked on a Xapian::Database object representing multiple databases, currently only the metadata for the first is considered but this behaviour may change in the future.
If the backend doesn't support metadata, then this method returns an iterator which compares equal to that returned by metadata_keys_end().
| prefix | If non-empty, only keys with this prefix are returned. |
| Xapian::UnimplementedError | will be thrown if the backend implements user-specified metadata, but doesn't implement iterating its keys (currently this happens for the InMemory backend). |
Definition at line 715 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), main(), and RemoteServer::msg_openmetadatakeylist().
| Xapian::TermIterator Xapian::Database::metadata_keys_end | ( | const std::string & | = std::string() |
) | const [inline] |
Corresponding end iterator to metadata_keys_begin().
Definition at line 456 of file database.h.
Referenced by DEFINE_TESTCASE(), main(), and RemoteServer::msg_openmetadatakeylist().
| void Xapian::Database::operator= | ( | const Database & | other | ) |
Assignment is allowed.
The internals are reference counted, so assignment is cheap.
| other | The object to copy. |
Definition at line 86 of file omdatabase.cc.
References internal, and LOGCALL_VOID.
| PositionIterator Xapian::Database::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.
Definition at line 226 of file omdatabase.cc.
References docid_zero_invalid(), LOGCALL, no_subdatabases(), rare, and RETURN.
Referenced by DEFINE_TESTCASE(), RemoteServer::msg_positionlist(), closedb1_iterators::perform(), test_emptyterm1_helper(), and test_emptyterm2_helper().
| PositionIterator Xapian::Database::positionlist_end | ( | Xapian::docid | , | |
| const std::string & | ||||
| ) | const [inline] |
Corresponding end iterator to positionlist_begin().
Definition at line 213 of file database.h.
Referenced by DEFINE_TESTCASE(), and RemoteServer::msg_positionlist().
| PostingIterator Xapian::Database::postlist_begin | ( | const std::string & | tname | ) | const |
An iterator pointing to the start of the postlist for a given term.
| tname | The termname to iterate postings for. 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. |
Definition at line 132 of file omdatabase.cc.
References Assert, LOGCALL, rare, and RETURN.
Referenced by Xapian::Compactor::Internal::add_source(), check_sparse_uid_terms(), dbcheck(), DEFINE_TESTCASE(), main(), RemoteServer::msg_postlist(), Xapian::FixedWeightPostingSource::next(), closedb1_iterators::perform(), postlist_to_string(), closedb1_iterators::setup(), show_db_stats(), and Xapian::FixedWeightPostingSource::skip_to().
| PostingIterator Xapian::Database::postlist_end | ( | const std::string & | ) | const [inline] |
Corresponding end iterator to postlist_begin().
Definition at line 186 of file database.h.
Referenced by Xapian::Compactor::Internal::add_source(), Xapian::FixedWeightPostingSource::at_end(), dbcheck(), DEFINE_TESTCASE(), main(), RemoteServer::msg_postlist(), Xapian::FixedWeightPostingSource::next(), postlist_to_string(), closedb1_iterators::setup(), show_db_stats(), and Xapian::FixedWeightPostingSource::skip_to().
| void Xapian::Database::reopen | ( | ) |
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.
Calling reopen() on a database which has been closed (with close()) will always raise a Xapian::DatabaseError.
Definition at line 98 of file omdatabase.cc.
References LOGCALL_VOID.
Referenced by DEFINE_TESTCASE(), RemoteServer::msg_reopen(), and closedb1_iterators::perform().
| TermIterator Xapian::Database::spellings_begin | ( | ) | const |
An iterator which returns all the spelling correction targets.
This returns all the words which are considered as targets for the spelling correction algorithm. The frequency of each word is available as the term frequency of each entry in the returned iterator.
Definition at line 651 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), and main().
| Xapian::TermIterator Xapian::Database::spellings_end | ( | ) | const [inline] |
Corresponding end iterator to spellings_begin().
Definition at line 382 of file database.h.
Referenced by DEFINE_TESTCASE(), and main().
| TermIterator Xapian::Database::synonym_keys_begin | ( | const std::string & | prefix = std::string() |
) | const |
An iterator which returns all terms which have synonyms.
| prefix | If non-empty, only terms with this prefix are returned. |
Definition at line 687 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by TermGroup::as_group(), DEFINE_TESTCASE(), and main().
| Xapian::TermIterator Xapian::Database::synonym_keys_end | ( | const std::string & | = std::string() |
) | const [inline] |
Corresponding end iterator to synonym_keys_begin(prefix).
Definition at line 405 of file database.h.
Referenced by TermGroup::as_group(), DEFINE_TESTCASE(), and main().
| TermIterator Xapian::Database::synonyms_begin | ( | const std::string & | term | ) | const |
An iterator which returns all the synonyms for a given term.
| term | The term to return synonyms for. |
Definition at line 669 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by TermGroup::as_group(), DEFINE_TESTCASE(), Term::get_query_with_synonyms(), and main().
| Xapian::TermIterator Xapian::Database::synonyms_end | ( | const std::string & | ) | const [inline] |
Corresponding end iterator to synonyms_begin(term).
Definition at line 393 of file database.h.
Referenced by TermGroup::as_group(), DEFINE_TESTCASE(), Term::get_query_with_synonyms(), and main().
| bool Xapian::Database::term_exists | ( | const std::string & | tname | ) | const |
Check if a given term exists in the database.
| tname | The term to test the existence of. |
Definition at line 465 of file omdatabase.cc.
References get_doccount(), LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), RemoteServer::msg_termexists(), Xapian::QueryParser::Internal::parse_term(), closedb1_iterators::perform(), test_emptyterm1_helper(), and test_emptyterm2_helper().
| TermIterator Xapian::Database::termlist_begin | ( | Xapian::docid | did | ) | const |
An iterator pointing to the start of the termlist for a given document.
| did | The document id of the document to iterate terms for. |
Definition at line 168 of file omdatabase.cc.
References Assert, docid_zero_invalid(), LOGCALL, no_subdatabases(), rare, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), docterms_to_string(), Xapian::Enquire::Internal::get_matching_terms(), RemoteServer::msg_termlist(), closedb1_iterators::perform(), show_termlist(), and test_termlist3_helper().
| TermIterator Xapian::Database::termlist_end | ( | Xapian::docid | ) | const [inline] |
Corresponding end iterator to termlist_begin().
Definition at line 199 of file database.h.
Referenced by dbcheck(), DEFINE_TESTCASE(), docterms_to_string(), Xapian::Enquire::Internal::get_matching_terms(), RemoteServer::msg_termlist(), and show_termlist().
| ValueIterator Xapian::Database::valuestream_begin | ( | Xapian::valueno | slot | ) | const |
Return an iterator over the value in slot slot for each document.
Definition at line 407 of file omdatabase.cc.
References LOGCALL, and RETURN.
Referenced by Xapian::ValuePostingSource::check(), dbcheck(), DEFINE_TESTCASE(), Xapian::ValuePostingSource::next(), closedb1_iterators::perform(), and Xapian::ValuePostingSource::skip_to().
| ValueIteratorEnd_ Xapian::Database::valuestream_end | ( | Xapian::valueno | ) | const [inline] |
Return end iterator corresponding to valuestream_begin().
Definition at line 331 of file database.h.
Referenced by Xapian::ValuePostingSource::at_end(), Xapian::ValuePostingSource::check(), Xapian::DecreasingValueWeightPostingSource::check(), dbcheck(), DEFINE_TESTCASE(), Xapian::ValuePostingSource::next(), Xapian::DecreasingValueWeightPostingSource::next(), Xapian::DecreasingValueWeightPostingSource::skip_if_in_range(), Xapian::ValuePostingSource::skip_to(), and Xapian::DecreasingValueWeightPostingSource::skip_to().
std::vector<Xapian::Internal::RefCntPtr<Internal> > Xapian::Database::internal [private] |
For internal use only.
Reference counted internals.
Definition at line 58 of file database.h.
Referenced by add_database(), Xapian::build_termlist_tree(), Database(), ValueStreamDocument::do_get_value(), MultiMatch::get_mset(), Xapian::Enquire::Internal::Internal(), MultiMatch::MultiMatch(), MultiTermList::MultiTermList(), ValueStreamDocument::new_subdb(), operator=(), Xapian::Enquire::Internal::read_doc(), Xapian::Enquire::Internal::request_doc(), and Xapian::DatabaseMaster::write_changesets_to_fd().