xapian-core
1.4.26
|
Base class for databases. More...
#include <database.h>
Public Member Functions | |
virtual | ~Internal () |
Destroy the database. More... | |
virtual void | keep_alive () |
Send a keep-alive signal to a remote database, to stop it from timing out. More... | |
virtual void | readahead_for_query (const Xapian::Query &query) |
virtual Xapian::doccount | get_doccount () const =0 |
Return the number of docs in this (sub) database. More... | |
virtual Xapian::docid | get_lastdocid () const =0 |
Return the last used document id of this (sub) database. More... | |
virtual Xapian::totallength | get_total_length () const =0 |
Return the total length of all documents in this database. More... | |
virtual Xapian::termcount | get_doclength (Xapian::docid did) const =0 |
Get the length of a given document. More... | |
virtual Xapian::termcount | get_unique_terms (Xapian::docid did) const =0 |
Get the number of unique term in document. More... | |
virtual void | get_freqs (const string &term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const =0 |
Returns frequencies for a term. More... | |
virtual Xapian::doccount | get_value_freq (Xapian::valueno slot) const =0 |
Return the frequency of a given value slot. More... | |
virtual std::string | get_value_lower_bound (Xapian::valueno slot) const =0 |
Get a lower bound on the values stored in the given value slot. More... | |
virtual std::string | get_value_upper_bound (Xapian::valueno slot) const =0 |
Get an upper bound on the values stored in the given value slot. More... | |
virtual Xapian::termcount | get_doclength_lower_bound () const |
Get a lower bound on the length of a document in this DB. More... | |
virtual Xapian::termcount | get_doclength_upper_bound () const |
Get an upper bound on the length of a document in this DB. More... | |
virtual Xapian::termcount | get_wdf_upper_bound (const std::string &term) const |
Get an upper bound on the wdf of term term. More... | |
virtual bool | term_exists (const string &tname) const =0 |
Check whether a given term is in the database. More... | |
virtual bool | has_positions () const =0 |
Check whether this database contains any positional information. More... | |
virtual LeafPostList * | open_post_list (const string &tname) const =0 |
Open a posting list. More... | |
virtual ValueList * | open_value_list (Xapian::valueno slot) const |
Open a value stream. More... | |
virtual TermList * | open_term_list (Xapian::docid did) const =0 |
Open a term list. More... | |
virtual TermList * | open_allterms (const string &prefix) const =0 |
Open an allterms list. More... | |
virtual PositionList * | open_position_list (Xapian::docid did, const string &tname) const =0 |
Open a position list for the given term in the given document. More... | |
virtual Xapian::Document::Internal * | open_document (Xapian::docid did, bool lazy) const =0 |
Open a document. More... | |
virtual TermList * | open_spelling_termlist (const string &word) const |
Create a termlist tree from trigrams of word. More... | |
virtual TermList * | open_spelling_wordlist () const |
Return a termlist which returns the words which are spelling correction targets. More... | |
virtual Xapian::doccount | get_spelling_frequency (const string &word) const |
Return the number of times word was added as a spelling. More... | |
virtual void | add_spelling (const string &word, Xapian::termcount freqinc) const |
Add a word to the spelling dictionary. More... | |
virtual void | remove_spelling (const string &word, Xapian::termcount freqdec) const |
Remove a word from the spelling dictionary. More... | |
virtual TermList * | open_synonym_termlist (const string &term) const |
Open a termlist returning synonyms for a term. More... | |
virtual TermList * | open_synonym_keylist (const string &prefix) const |
Open a termlist returning each term which has synonyms. More... | |
virtual void | add_synonym (const string &term, const string &synonym) const |
Add a synonym for a term. More... | |
virtual void | remove_synonym (const string &term, const string &synonym) const |
Remove a synonym for a term. More... | |
virtual void | clear_synonyms (const string &term) const |
Clear all synonyms for a term. More... | |
virtual string | get_metadata (const string &key) const |
Get the metadata associated with a given key. More... | |
virtual TermList * | open_metadata_keylist (const std::string &prefix) const |
Open a termlist returning each metadata key. More... | |
virtual void | set_metadata (const string &key, const string &value) |
Set the metadata associated with a given key. More... | |
virtual bool | reopen () |
Reopen the database to the latest available revision. More... | |
virtual void | close ()=0 |
Close the database. More... | |
virtual void | commit () |
Commit pending modifications to the database. More... | |
virtual void | cancel () |
Cancel pending modifications to the database. More... | |
void | begin_transaction (bool flushed) |
Begin a transaction. More... | |
void | commit_transaction () |
Commit a transaction. More... | |
void | cancel_transaction () |
Cancel a transaction. More... | |
virtual Xapian::docid | add_document (const Xapian::Document &document) |
Add a new document to the database. More... | |
virtual void | delete_document (Xapian::docid did) |
Delete a document in the database. More... | |
virtual void | delete_document (const string &unique_term) |
Delete any documents indexed by a term from the database. More... | |
virtual void | replace_document (Xapian::docid did, const Xapian::Document &document) |
Replace a given document in the database. More... | |
virtual Xapian::docid | replace_document (const string &unique_term, const Xapian::Document &document) |
Replace any documents matching a term. More... | |
virtual void | write_changesets_to_fd (int fd, const std::string &start_revision, bool need_whole_db, Xapian::ReplicationInfo *info) |
Write a set of changesets to a file descriptor. More... | |
virtual string | get_revision_info () const |
Get a string describing the current revision of the database. More... | |
virtual string | get_uuid () const |
Get a UUID for the database. More... | |
virtual void | invalidate_doc_object (Xapian::Document::Internal *obj) const |
Notify the database that document is no longer valid. More... | |
virtual int | get_backend_info (string *path) const =0 |
Get backend information about this database. More... | |
virtual void | get_used_docid_range (Xapian::docid &first, Xapian::docid &last) const |
Find lowest and highest docids actually in use. More... | |
virtual bool | locked () const |
Return true if the database is open for writing. More... | |
virtual void | request_document (Xapian::docid) const |
Request and later collect a document from the database. More... | |
virtual Xapian::Document::Internal * | collect_document (Xapian::docid did) const |
Request and later collect a document from the database. More... | |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
intrusive_base () | |
Construct with no references. More... | |
Protected Types | |
enum | { TRANSACTION_UNIMPLEMENTED = -1, TRANSACTION_NONE = 0, TRANSACTION_UNFLUSHED = 1, TRANSACTION_FLUSHED = 2 } |
Transaction state. More... | |
Protected Member Functions | |
bool | transaction_active () const |
Internal () | |
Create a database - called only by derived classes. More... | |
void | dtor_called () |
Internal method to perform cleanup when a writable database is destroyed with uncommitted changes. More... | |
Protected Attributes | |
enum Xapian::Database::Internal:: { ... } | transaction_state |
Transaction state. More... | |
Private Member Functions | |
Internal (const Internal &) | |
Copies are not allowed. More... | |
void | operator= (const Internal &) |
Assignment is not allowed. More... | |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
unsigned | _refs |
Reference count. More... | |
Base class for databases.
Definition at line 57 of file database.h.
|
protected |
Transaction state.
Enumerator | |
---|---|
TRANSACTION_UNIMPLEMENTED | |
TRANSACTION_NONE | |
TRANSACTION_UNFLUSHED | |
TRANSACTION_FLUSHED |
Definition at line 67 of file database.h.
|
private |
Copies are not allowed.
|
inlineprotected |
Create a database - called only by derived classes.
Definition at line 77 of file database.h.
References add_document(), add_spelling(), add_synonym(), begin_transaction(), cancel(), cancel_transaction(), clear_synonyms(), close(), collect_document(), commit(), commit_transaction(), delete_document(), dtor_called(), get_backend_info(), get_doccount(), get_doclength(), get_doclength_lower_bound(), get_doclength_upper_bound(), get_freqs(), get_lastdocid(), get_metadata(), get_revision_info(), get_spelling_frequency(), get_total_length(), get_unique_terms(), get_used_docid_range(), get_uuid(), get_value_freq(), get_value_lower_bound(), get_value_upper_bound(), get_wdf_upper_bound(), has_positions(), invalidate_doc_object(), keep_alive(), locked(), open_allterms(), open_document(), open_metadata_keylist(), open_position_list(), open_post_list(), open_spelling_termlist(), open_spelling_wordlist(), open_synonym_keylist(), open_synonym_termlist(), open_term_list(), open_value_list(), query(), readahead_for_query(), remove_spelling(), remove_synonym(), reopen(), replace_document(), request_document(), set_metadata(), term_exists(), write_changesets_to_fd(), and ~Internal().
|
virtual |
Destroy the database.
This method should not be called until all objects using the database have been cleaned up.
If any transactions are in progress, they should be finished by cancel_transaction() or commit_transaction() - if this is not done, the destructor will attempt to clean things up by cancelling the transaction, but any errors produced by these operations will not be reported.
Definition at line 42 of file database.cc.
Referenced by Internal().
|
virtual |
Add a new document to the database.
See WritableDatabase::add_document() for more information.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, and RemoteDatabase.
Definition at line 161 of file database.cc.
References Assert.
Referenced by Internal().
|
virtual |
Add a word to the spelling dictionary.
If the word is already present, its frequency is increased.
word | The word to add. |
freqinc | How much to increase its frequency by. |
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, and RemoteDatabase.
Definition at line 244 of file database.cc.
Referenced by Internal().
|
virtual |
Add a synonym for a term.
If synonym is already a synonym for term, then no action is taken.
Reimplemented in ChertWritableDatabase, and GlassWritableDatabase.
Definition at line 274 of file database.cc.
Referenced by Internal().
void Xapian::Database::Internal::begin_transaction | ( | bool | flushed | ) |
Begin a transaction.
See WritableDatabase::begin_transaction() for more information.
Definition at line 116 of file database.cc.
Referenced by Internal().
|
virtual |
Cancel pending modifications to the database.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, RemoteDatabase, ChertDatabase, and GlassDatabase.
Definition at line 109 of file database.cc.
References Assert.
Referenced by Internal().
void Xapian::Database::Internal::cancel_transaction | ( | ) |
Cancel a transaction.
See WritableDatabase::cancel_transaction() for more information.
Definition at line 149 of file database.cc.
Referenced by RemoteDatabase::do_close(), and Internal().
|
virtual |
Clear all synonyms for a term.
If term has no synonyms, no action is taken.
Reimplemented in ChertWritableDatabase, and GlassWritableDatabase.
Definition at line 286 of file database.cc.
Referenced by Internal().
|
pure virtual |
Close the database.
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, RemoteDatabase, ChertDatabase, and GlassDatabase.
Referenced by Internal().
|
virtual |
Request and later collect a document from the database.
Multiple documents can be requested with request_document(), and then collected with collect_document(). Allows the backend to optimise (e.g. the remote backend can start requests for all the documents so they fetch in parallel).
If a backend doesn't support this, request_document() can be a no-op and collect_document() the same as open_document().
Definition at line 326 of file database.cc.
Referenced by Internal().
|
virtual |
Commit pending modifications to the database.
See WritableDatabase::commit() for more information.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, and RemoteDatabase.
Definition at line 102 of file database.cc.
References Assert.
Referenced by Internal().
void Xapian::Database::Internal::commit_transaction | ( | ) |
Commit a transaction.
See WritableDatabase::commit_transaction() for more information.
Definition at line 134 of file database.cc.
Referenced by Internal().
|
virtual |
Delete a document in the database.
See WritableDatabase::delete_document() for more information.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, and RemoteDatabase.
Definition at line 169 of file database.cc.
References Assert.
Referenced by Internal().
|
virtual |
Delete any documents indexed by a term from the database.
See WritableDatabase::delete_document() for more information.
Reimplemented in RemoteDatabase.
Definition at line 176 of file database.cc.
References Xapian::PostingIterator::Internal::at_end(), Xapian::PostingIterator::Internal::get_docid(), and Xapian::PostingIterator::Internal::next().
|
protected |
Internal method to perform cleanup when a writable database is destroyed with uncommitted changes.
A derived class' destructor should call this method before destroying the database to ensure that no sessions or transactions are in progress at destruction time.
Note that it is not safe to throw exceptions from destructors, so this method will catch and discard any exceptions.
Definition at line 87 of file database.cc.
Referenced by Internal(), ChertWritableDatabase::~ChertWritableDatabase(), GlassWritableDatabase::~GlassWritableDatabase(), and InMemoryDatabase::~InMemoryDatabase().
|
pure virtual |
Get backend information about this database.
path | If non-NULL, and set the pointed to string to the file path of this database (or if to some string describing the database in a backend-specified format if "path" isn't a concept which make sense). |
Implemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal(), and MultiMatch::MultiMatch().
|
pure virtual |
Return the number of docs in this (sub) database.
Implemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), Xapian::Database::compact_(), and Internal().
|
pure virtual |
Get the length of a given document.
Document length, for the purposes of Xapian, is defined to be the number of instances of terms within a document. Expressed differently, the sum of the within document frequencies over all the terms in the document.
did | The document id of the document whose length is being requested. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal().
|
virtual |
Get a lower bound on the length of a document in this DB.
This bound does not include any zero-length documents.
Reimplemented in ChertDatabase, RemoteDatabase, and GlassDatabase.
Definition at line 59 of file database.cc.
Referenced by Internal().
|
virtual |
Get an upper bound on the length of a document in this DB.
Reimplemented in ChertDatabase, RemoteDatabase, and GlassDatabase.
Definition at line 67 of file database.cc.
Referenced by Internal().
|
pure virtual |
Returns frequencies for a term.
term | The term to get frequencies for |
termfreq_ptr | Point to return number of docs indexed by term (or NULL not to return) |
collfreq_ptr | Point to return number of occurrences of term in the database (or NULL not to return) |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Internal().
|
pure virtual |
Return the last used document id of this (sub) database.
Implemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Database::compact_(), and Internal().
|
virtual |
Get the metadata associated with a given key.
See Database::get_metadata() for more information.
Reimplemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Definition at line 292 of file database.cc.
Referenced by Internal().
|
virtual |
Get a string describing the current revision of the database.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 341 of file database.cc.
Referenced by Internal().
|
virtual |
Return the number of times word was added as a spelling.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 235 of file database.cc.
Referenced by Internal().
|
pure virtual |
Return the total length of all documents in this database.
Implemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Internal().
|
pure virtual |
Get the number of unique term in document.
did | The document id of the document whose number of terms is being requested. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal().
|
virtual |
Find lowest and highest docids actually in use.
Only used by compaction, so only needs to be implemented by backends which support compaction.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 359 of file database.cc.
Referenced by Xapian::Database::compact_(), and Internal().
|
virtual |
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 the empty string is returned.
Reimplemented in ChertDatabase, GlassDatabase, and RemoteDatabase.
Definition at line 347 of file database.cc.
Referenced by Internal().
|
pure virtual |
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. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, RemoteDatabase, and GlassDatabase.
Referenced by Internal(), Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
pure virtual |
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.
slot | The value slot to examine. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, RemoteDatabase, and GlassDatabase.
Referenced by Internal(), Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
pure virtual |
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. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, RemoteDatabase, and GlassDatabase.
Referenced by Internal(), Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
virtual |
Get an upper bound on the wdf of term term.
Reimplemented in ChertDatabase, RemoteDatabase, and GlassDatabase.
Definition at line 75 of file database.cc.
Referenced by Internal().
|
pure virtual |
Check whether this database contains any positional information.
Implemented in GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal(), and Xapian::Internal::QueryWindowed::postlist_windowed().
|
virtual |
Notify the database that document is no longer valid.
This is used to invalidate references to a document kept by a database for doing lazy updates. If we moved to using a weak_ptr instead we wouldn't need a special method for this, but it would involve a fair bit of reorganising of other parts of the code.
Reimplemented in ChertWritableDatabase, and GlassWritableDatabase.
Definition at line 353 of file database.cc.
Referenced by Internal().
|
virtual |
Send a keep-alive signal to a remote database, to stop it from timing out.
Reimplemented in RemoteDatabase.
Definition at line 47 of file database.cc.
Referenced by Internal().
|
virtual |
Return true if the database is open for writing.
If this is a WritableDatabase, always returns true.
For a Database, test if there's a writer holding the lock (or if we can't test for a lock without taking it on the current platform, throw Xapian::UnimplementedError).
Reimplemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Definition at line 366 of file database.cc.
Referenced by Internal().
|
pure virtual |
Open an allterms list.
This is a list of all the terms in the database
prefix | The prefix to restrict the terms to. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal(), and Xapian::Internal::QueryWildcard::postlist().
|
pure virtual |
Open a document.
This is used to access the values and data associated with a document. See class Xapian::Document::Internal for further details.
did | The document id which is being requested. |
lazy | No need to check that this document actually exists. Used when we already know that this document exists (only a hint - the backend may still check). |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal().
|
virtual |
Open a termlist returning each metadata key.
Only metadata keys which are associated with a non-empty value will be returned.
prefix | If non-empty, only keys with this prefix are returned. |
Reimplemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Definition at line 298 of file database.cc.
Referenced by Internal().
|
pure virtual |
Open a position list for the given term in the given document.
did | The document id for which a position list is being requested. |
tname | The term for which a position list is being requested. |
Implemented in GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal().
|
pure virtual |
Open a posting list.
Method defined by subclass to open a posting list. This is a list of all the documents which contain a given term.
tname | The term whose posting list is being requested. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Database::compact_(), Internal(), Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
virtual |
Create a termlist tree from trigrams of word.
You can assume word.size() > 1.
If there are no trigrams, returns NULL.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 217 of file database.cc.
Referenced by Internal().
|
virtual |
Return a termlist which returns the words which are spelling correction targets.
If there are no spelling correction targets, returns NULL.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, ChertDatabase, and GlassDatabase.
Definition at line 226 of file database.cc.
Referenced by Internal().
|
virtual |
Open a termlist returning each term which has synonyms.
prefix | If non-empty, only terms with this prefix are returned. |
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, ChertDatabase, and GlassDatabase.
Definition at line 265 of file database.cc.
Referenced by Internal().
|
virtual |
Open a termlist returning synonyms for a term.
If term has no synonyms, returns NULL.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 256 of file database.cc.
Referenced by Internal().
|
pure virtual |
Open a term list.
This is a list of all the terms contained by a given document.
did | The document id whose term list is being requested. |
Implemented in InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Internal().
|
virtual |
Open a value stream.
This returns the value in a particular slot for each document.
slot | The value slot. |
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, ChertDatabase, and GlassDatabase.
Definition at line 211 of file database.cc.
Referenced by Internal().
|
private |
Assignment is not allowed.
|
virtual |
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 54 of file database.cc.
Referenced by Internal(), and MultiMatch::MultiMatch().
|
virtual |
Remove a word from the spelling dictionary.
The word's frequency is decreased, and if would become zero or less then the word is removed completely.
word | The word to remove. |
freqdec | How much to decrease its frequency by. |
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, and RemoteDatabase.
Definition at line 250 of file database.cc.
Referenced by Internal().
|
virtual |
Remove a synonym for a term.
If synonym isn't a synonym for term, then no action is taken.
Reimplemented in ChertWritableDatabase, and GlassWritableDatabase.
Definition at line 280 of file database.cc.
Referenced by Internal().
|
virtual |
Reopen the database to the latest available revision.
Database backends which don't support simultaneous update and reading probably don't need to do anything here.
Reimplemented in InMemoryDatabase, RemoteDatabase, ChertDatabase, and GlassDatabase.
Definition at line 312 of file database.cc.
Referenced by Internal().
|
virtual |
Replace a given document in the database.
See WritableDatabase::replace_document() for more information.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, and RemoteDatabase.
Definition at line 186 of file database.cc.
References Assert.
Referenced by Internal().
|
virtual |
Replace any documents matching a term.
See WritableDatabase::replace_document() for more information.
Reimplemented in RemoteDatabase.
Definition at line 193 of file database.cc.
References Xapian::PostingIterator::Internal::at_end(), Xapian::PostingIterator::Internal::get_docid(), and Xapian::PostingIterator::Internal::next().
|
virtual |
Request and later collect a document from the database.
Multiple documents can be requested with request_document(), and then collected with collect_document(). Allows the backend to optimise (e.g. the remote backend can start requests for all the documents so they fetch in parallel).
If a backend doesn't support this, request_document() can be a no-op and collect_document() the same as open_document().
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 321 of file database.cc.
Referenced by Internal().
|
virtual |
Set the metadata associated with a given key.
See WritableDatabase::set_metadata() for more information.
Reimplemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, and RemoteDatabase.
Definition at line 306 of file database.cc.
Referenced by Internal().
|
pure virtual |
Check whether a given term is in the database.
tname | The term whose presence is being checked. |
Implemented in ChertWritableDatabase, GlassWritableDatabase, InMemoryDatabase, ChertDatabase, GlassDatabase, and RemoteDatabase.
Referenced by Internal().
|
inlineprotected |
Definition at line 74 of file database.h.
References transaction_state.
Referenced by GlassWritableDatabase::check_flush_threshold(), ChertWritableDatabase::check_flush_threshold(), GlassWritableDatabase::close(), ChertWritableDatabase::close(), GlassWritableDatabase::commit(), ChertWritableDatabase::commit(), and RemoteDatabase::do_close().
|
virtual |
Write a set of changesets to a file descriptor.
This call may reopen the database, leaving it pointing to a more recent version of the database.
Reimplemented in ChertDatabase, and GlassDatabase.
Definition at line 335 of file database.cc.
Referenced by Internal().
enum { ... } Xapian::Database::Internal::transaction_state |
Transaction state.
Referenced by RemoteDatabase::do_close(), InMemoryDatabase::InMemoryDatabase(), RemoteDatabase::RemoteDatabase(), and transaction_active().