Xapian::Database::Internal Class Reference

Base class for databases. More...

#include <database.h>

Inheritance diagram for Xapian::Database::Internal:

Inheritance graph
[legend]
Collaboration diagram for Xapian::Database::Internal:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Internal ()
 Destroy the database.
virtual void keep_alive ()
 Send a keep-alive signal to a remote database, to stop it from timing out.
virtual Xapian::doccount get_doccount () const =0
 Return the number of docs in this (sub) database.
virtual Xapian::docid get_lastdocid () const =0
 Return the last used document id of this (sub) database.
virtual totlen_t get_total_length () const =0
 Return the total length of all documents in this database.
virtual Xapian::doclength get_avlength () const =0
 Return the average length of a document in this (sub) database.
virtual Xapian::termcount get_doclength (Xapian::docid did) const =0
 Get the length of a given document.
virtual Xapian::doccount get_termfreq (const string &tname) const =0
 Return the number of documents indexed by a given term.
virtual Xapian::termcount get_collection_freq (const string &tname) const =0
 Return the total number of occurrences of the given term.
virtual Xapian::doccount get_value_freq (Xapian::valueno slot) const
 Return the frequency of a given value slot.
virtual std::string get_value_lower_bound (Xapian::valueno slot) const
 Get a lower bound on the values stored in the given value slot.
virtual std::string get_value_upper_bound (Xapian::valueno slot) const
 Get an upper bound on the values stored in the given value slot.
virtual Xapian::termcount get_doclength_lower_bound () const
 Get a lower bound on the length of a document in this DB.
virtual Xapian::termcount get_doclength_upper_bound () const
 Get an upper bound on the length of a document in this DB.
virtual Xapian::termcount get_wdf_upper_bound (const std::string &term) const
 Get an upper bound on the wdf of term term.
virtual bool term_exists (const string &tname) const =0
 Check whether a given term is in the database.
virtual bool has_positions () const =0
 Check whether this database contains any positional information.
virtual LeafPostListopen_post_list (const string &tname) const =0
 Open a posting list.
virtual ValueListopen_value_list (Xapian::valueno slot) const
 Open a value stream.
virtual TermListopen_term_list (Xapian::docid did) const =0
 Open a term list.
virtual TermListopen_allterms (const string &prefix) const =0
 Open an allterms list.
virtual PositionListopen_position_list (Xapian::docid did, const string &tname) const =0
 Open a position list for the given term in the given document.
virtual
Xapian::Document::Internal
open_document (Xapian::docid did, bool lazy) const =0
 Open a document.
virtual TermListopen_spelling_termlist (const string &word) const
 Create a termlist tree from trigrams of word.
virtual TermListopen_spelling_wordlist () const
 Return a termlist which returns the words which are spelling correction targets.
virtual Xapian::doccount get_spelling_frequency (const string &word) const
 Return the number of times word was added as a spelling.
virtual void add_spelling (const string &word, Xapian::termcount freqinc) const
 Add a word to the spelling dictionary.
virtual void remove_spelling (const string &word, Xapian::termcount freqdec) const
 Remove a word from the spelling dictionary.
virtual TermListopen_synonym_termlist (const string &term) const
 Open a termlist returning synonyms for a term.
virtual TermListopen_synonym_keylist (const string &prefix) const
 Open a termlist returning each term which has synonyms.
virtual void add_synonym (const string &term, const string &synonym) const
 Add a synonym for a term.
virtual void remove_synonym (const string &term, const string &synonym) const
 Remove a synonym for a term.
virtual void clear_synonyms (const string &term) const
 Clear all synonyms for a term.
virtual string get_metadata (const string &key) const
 Get the metadata associated with a given key.
virtual TermListopen_metadata_keylist (const std::string &prefix) const
 Open a termlist returning each metadata key.
virtual void set_metadata (const string &key, const string &value)
 Set the metadata associated with a given key.
virtual void reopen ()
 Reopen the database to the latest available revision.
virtual void close ()=0
 Close the database.
virtual void commit ()
 Commit pending modifications to the database.
virtual void cancel ()
 Cancel pending modifications to the database.
void begin_transaction (bool flushed)
 Begin a transaction.
void commit_transaction ()
 Commit a transaction.
void cancel_transaction ()
 Cancel a transaction.
virtual Xapian::docid add_document (const Xapian::Document &document)
 Add a new document to the database.
virtual void delete_document (Xapian::docid did)
 Delete a document in the database.
virtual void delete_document (const string &unique_term)
 Delete any documents indexed by a term from the database.
virtual void replace_document (Xapian::docid did, const Xapian::Document &document)
 Replace a given document in the database.
virtual Xapian::docid replace_document (const string &unique_term, const Xapian::Document &document)
 Replace any documents matching a term.
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.
virtual string get_revision_info () const
 Get a string describing the current revision of the database.
virtual string get_uuid () const
 Get a UUID for the database.
virtual void invalidate_doc_object (Xapian::Document::Internal *obj) const
 Notify the database that document is no longer valid.
virtual RemoteDatabaseas_remotedatabase ()
 Return a pointer to this object as a RemoteDatabase, or NULL.
virtual void request_document (Xapian::docid) const
 Request and later collect a document from the database.
virtual
Xapian::Document::Internal
collect_document (Xapian::docid did) const
 Request and later collect a document from the database.

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.
void dtor_called ()
 Internal method to perform cleanup when a writable database is destroyed with uncommitted changes.

Protected Attributes

enum
Xapian::Database::Internal:: { ... }  
transaction_state
 Transaction state.

Private Member Functions

 Internal (const Internal &)
 Copies are not allowed.
void operator= (const Internal &)
 Assignment is not allowed.


Detailed Description

Base class for databases.

Definition at line 57 of file database.h.


Member Enumeration Documentation

anonymous enum [protected]

Transaction state.

Enumerator:
TRANSACTION_UNIMPLEMENTED 
TRANSACTION_NONE 
TRANSACTION_UNFLUSHED 
TRANSACTION_FLUSHED 

Definition at line 67 of file database.h.


Constructor & Destructor Documentation

Xapian::Database::Internal::Internal ( const Internal  )  [private]

Copies are not allowed.

Xapian::Database::Internal::Internal (  )  [inline, protected]

Create a database - called only by derived classes.

Definition at line 77 of file database.h.

Xapian::Database::Internal::~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 41 of file database.cc.


Member Function Documentation

Xapian::docid Xapian::Database::Internal::add_document ( const Xapian::Document document  )  [virtual]

Add a new document to the database.

See WritableDatabase::add_document() for more information.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 171 of file database.cc.

References Assert.

Referenced by replace_document().

void Xapian::Database::Internal::add_spelling ( const string &  word,
Xapian::termcount  freqinc 
) const [virtual]

Add a word to the spelling dictionary.

If the word is already present, its frequency is increased.

Parameters:
word The word to add.
freqinc How much to increase its frequency by.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 254 of file database.cc.

void Xapian::Database::Internal::add_synonym ( const string &  term,
const string &  synonym 
) const [virtual]

Add a synonym for a term.

If synonym is already a synonym for term, then no action is taken.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 284 of file database.cc.

RemoteDatabase * Xapian::Database::Internal::as_remotedatabase (  )  [virtual]

Return a pointer to this object as a RemoteDatabase, or NULL.

This method is used by MultiMatch to decide whether to use a LocalSubMatch or a RemoteSubMatch to perform a search over the database.

Reimplemented in ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 367 of file database.cc.

Referenced by MultiMatch::MultiMatch().

void Xapian::Database::Internal::begin_transaction ( bool  flushed  ) 

Begin a transaction.

See WritableDatabase::begin_transaction() for more information.

Reimplemented in ConstDatabaseWrapper.

Definition at line 126 of file database.cc.

References commit(), TRANSACTION_FLUSHED, TRANSACTION_NONE, transaction_state, TRANSACTION_UNFLUSHED, and TRANSACTION_UNIMPLEMENTED.

void Xapian::Database::Internal::cancel (  )  [virtual]

Cancel pending modifications to the database.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 119 of file database.cc.

References Assert.

Referenced by cancel_transaction().

void Xapian::Database::Internal::cancel_transaction (  ) 

Cancel a transaction.

See WritableDatabase::cancel_transaction() for more information.

Reimplemented in ConstDatabaseWrapper.

Definition at line 159 of file database.cc.

References cancel(), transaction_active(), TRANSACTION_NONE, transaction_state, and TRANSACTION_UNIMPLEMENTED.

Referenced by dtor_called().

void Xapian::Database::Internal::clear_synonyms ( const string &  term  )  const [virtual]

Clear all synonyms for a term.

If term has no synonyms, no action is taken.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 296 of file database.cc.

virtual void Xapian::Database::Internal::close (  )  [pure virtual]

Xapian::Document::Internal * Xapian::Database::Internal::collect_document ( Xapian::docid  did  )  const [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 ConstDatabaseWrapper.

Definition at line 334 of file database.cc.

References open_document().

void Xapian::Database::Internal::commit (  )  [virtual]

Commit pending modifications to the database.

See WritableDatabase::commit() for more information.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 112 of file database.cc.

References Assert.

Referenced by begin_transaction(), commit_transaction(), and dtor_called().

void Xapian::Database::Internal::commit_transaction (  ) 

Commit a transaction.

See WritableDatabase::commit_transaction() for more information.

Reimplemented in ConstDatabaseWrapper.

Definition at line 144 of file database.cc.

References commit(), transaction_active(), TRANSACTION_FLUSHED, TRANSACTION_NONE, transaction_state, and TRANSACTION_UNIMPLEMENTED.

void Xapian::Database::Internal::delete_document ( const string &  unique_term  )  [virtual]

Delete any documents indexed by a term from the database.

See WritableDatabase::delete_document() for more information.

Reimplemented in ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 186 of file database.cc.

References delete_document(), and open_post_list().

void Xapian::Database::Internal::delete_document ( Xapian::docid  did  )  [virtual]

Delete a document in the database.

See WritableDatabase::delete_document() for more information.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 179 of file database.cc.

References Assert.

Referenced by delete_document(), and replace_document().

void Xapian::Database::Internal::dtor_called (  )  [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 97 of file database.cc.

References cancel_transaction(), commit(), transaction_active(), TRANSACTION_NONE, and transaction_state.

Referenced by RemoteDatabase::do_close(), BrassWritableDatabase::~BrassWritableDatabase(), ChertWritableDatabase::~ChertWritableDatabase(), FlintWritableDatabase::~FlintWritableDatabase(), and InMemoryDatabase::~InMemoryDatabase().

virtual Xapian::doclength Xapian::Database::Internal::get_avlength (  )  const [pure virtual]

Return the average length of a document in this (sub) database.

See Database::Internal::get_doclength() for the meaning of document length within Xapian.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

virtual Xapian::termcount Xapian::Database::Internal::get_collection_freq ( const string &  tname  )  const [pure virtual]

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: ie, the sum of the within document frequencies of the term.

Parameters:
tname The term whose collection frequency is being requested.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by get_wdf_upper_bound().

virtual Xapian::doccount Xapian::Database::Internal::get_doccount (  )  const [pure virtual]

virtual Xapian::termcount Xapian::Database::Internal::get_doclength ( Xapian::docid  did  )  const [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.

Parameters:
did The document id of the document whose length is being requested.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Xapian::termcount Xapian::Database::Internal::get_doclength_lower_bound (  )  const [virtual]

Get a lower bound on the length of a document in this DB.

Reimplemented in BrassDatabase, ChertDatabase, and RemoteDatabase.

Definition at line 71 of file database.cc.

Xapian::termcount Xapian::Database::Internal::get_doclength_upper_bound (  )  const [virtual]

Get an upper bound on the length of a document in this DB.

Reimplemented in BrassDatabase, ChertDatabase, and RemoteDatabase.

Definition at line 79 of file database.cc.

References get_total_length().

virtual Xapian::docid Xapian::Database::Internal::get_lastdocid (  )  const [pure virtual]

Return the last used document id of this (sub) database.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by ValueRangePostList::check(), and ValueGePostList::check().

string Xapian::Database::Internal::get_metadata ( const string &  key  )  const [virtual]

Get the metadata associated with a given key.

See Database::get_metadata() for more information.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 302 of file database.cc.

string Xapian::Database::Internal::get_revision_info (  )  const [virtual]

Get a string describing the current revision of the database.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, and ConstDatabaseWrapper.

Definition at line 349 of file database.cc.

Xapian::doccount Xapian::Database::Internal::get_spelling_frequency ( const string &  word  )  const [virtual]

Return the number of times word was added as a spelling.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, and ConstDatabaseWrapper.

Definition at line 245 of file database.cc.

virtual Xapian::doccount Xapian::Database::Internal::get_termfreq ( const string &  tname  )  const [pure virtual]

Return the number of documents indexed by a given term.

This may be an approximation, but must be an upper bound (ie, greater or equal to the true value), and should be as accurate as possible.

Parameters:
tname The term whose term frequency is being requested.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by Xapian::Weight::Internal::accumulate_stats().

virtual totlen_t Xapian::Database::Internal::get_total_length (  )  const [pure virtual]

Return the total length of all documents in this database.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by Xapian::Weight::Internal::accumulate_stats(), and get_doclength_upper_bound().

string Xapian::Database::Internal::get_uuid (  )  const [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 BrassDatabase, ChertDatabase, FlintDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 355 of file database.cc.

Xapian::doccount Xapian::Database::Internal::get_value_freq ( Xapian::valueno  slot  )  const [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.

Parameters:
slot The value slot to examine.
Exceptions:
UnimplementedError The frequency of the value isn't available for this database type.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 53 of file database.cc.

string Xapian::Database::Internal::get_value_lower_bound ( Xapian::valueno  slot  )  const [virtual]

Get a lower bound on the values stored in the given value slot.

If the lower bound isn't available for the given database type, this will return the lowest possible bound - the empty string.

Parameters:
slot The value slot to examine.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 59 of file database.cc.

Referenced by QueryOptimiser::do_subquery().

string Xapian::Database::Internal::get_value_upper_bound ( Xapian::valueno  slot  )  const [virtual]

Get an upper bound on the values stored in the given value slot.

Parameters:
slot The value slot to examine.
Exceptions:
UnimplementedError The upper bound of the values isn't available for this database type.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 65 of file database.cc.

Referenced by QueryOptimiser::do_subquery().

Xapian::termcount Xapian::Database::Internal::get_wdf_upper_bound ( const std::string &  term  )  const [virtual]

Get an upper bound on the wdf of term term.

Reimplemented in BrassDatabase, ChertDatabase, and RemoteDatabase.

Definition at line 87 of file database.cc.

References get_collection_freq().

virtual bool Xapian::Database::Internal::has_positions (  )  const [pure virtual]

Check whether this database contains any positional information.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by QueryOptimiser::do_and_like().

void Xapian::Database::Internal::invalidate_doc_object ( Xapian::Document::Internal obj  )  const [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 BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 361 of file database.cc.

void Xapian::Database::Internal::keep_alive (  )  [virtual]

Send a keep-alive signal to a remote database, to stop it from timing out.

Reimplemented in RemoteDatabase.

Definition at line 46 of file database.cc.

virtual TermList* Xapian::Database::Internal::open_allterms ( const string &  prefix  )  const [pure virtual]

Open an allterms list.

This is a list of all the terms in the database

Parameters:
prefix The prefix to restrict the terms to.
Returns:
A pointer to the newly created allterms list. This object must be deleted by the caller after use.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

virtual Xapian::Document::Internal* Xapian::Database::Internal::open_document ( Xapian::docid  did,
bool  lazy 
) const [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.

Parameters:
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).
Returns:
A pointer to the newly created document object. This object must be deleted by the caller after use.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by collect_document().

TermList * Xapian::Database::Internal::open_metadata_keylist ( const std::string &  prefix  )  const [virtual]

Open a termlist returning each metadata key.

Only metadata keys which are associated with a non-empty value will be returned.

Parameters:
prefix If non-empty, only keys with this prefix are returned.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 308 of file database.cc.

virtual PositionList* Xapian::Database::Internal::open_position_list ( Xapian::docid  did,
const string &  tname 
) const [pure virtual]

Open a position list for the given term in the given document.

Parameters:
did The document id for which a position list is being requested.
tname The term for which a position list is being requested.
Returns:
A pointer to the newly created position list. This object must be deleted by the caller after use.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

virtual LeafPostList* Xapian::Database::Internal::open_post_list ( const string &  tname  )  const [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.

Parameters:
tname The term whose posting list is being requested.
Returns:
A pointer to the newly created posting list. If the term doesn't exist, a LeafPostList object returning no documents is returned, which makes it easier to implement a search over multiple databases. This object must be deleted by the caller after use.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by delete_document(), LocalSubMatch::postlist_from_op_leaf_query(), and replace_document().

TermList * Xapian::Database::Internal::open_spelling_termlist ( const string &  word  )  const [virtual]

Create a termlist tree from trigrams of word.

You can assume word.size() > 1.

If there are no trigrams, returns NULL.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, and ConstDatabaseWrapper.

Definition at line 227 of file database.cc.

TermList * Xapian::Database::Internal::open_spelling_wordlist (  )  const [virtual]

Return a termlist which returns the words which are spelling correction targets.

If there are no spelling correction targets, returns NULL.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 236 of file database.cc.

TermList * Xapian::Database::Internal::open_synonym_keylist ( const string &  prefix  )  const [virtual]

Open a termlist returning each term which has synonyms.

Parameters:
prefix If non-empty, only terms with this prefix are returned.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 275 of file database.cc.

TermList * Xapian::Database::Internal::open_synonym_termlist ( const string &  term  )  const [virtual]

Open a termlist returning synonyms for a term.

If term has no synonyms, returns NULL.

Reimplemented in BrassDatabase, ChertDatabase, FlintDatabase, and ConstDatabaseWrapper.

Definition at line 266 of file database.cc.

virtual TermList* Xapian::Database::Internal::open_term_list ( Xapian::docid  did  )  const [pure virtual]

Open a term list.

This is a list of all the terms contained by a given document.

Parameters:
did The document id whose term list is being requested.
Returns:
A pointer to the newly created term list. This object must be deleted by the caller after use.

Implemented in BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Referenced by Xapian::Weight::Internal::accumulate_stats().

ValueList * Xapian::Database::Internal::open_value_list ( Xapian::valueno  slot  )  const [virtual]

Open a value stream.

This returns the value in a particular slot for each document.

Parameters:
slot The value slot.
Returns:
Pointer to a new ValueList object which should be deleted by the caller once it is no longer needed.

Reimplemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, and ConstDatabaseWrapper.

Definition at line 221 of file database.cc.

Referenced by ValueRangePostList::check(), ValueGePostList::check(), ValueRangePostList::next(), ValueGePostList::next(), ValueRangePostList::skip_to(), and ValueGePostList::skip_to().

void Xapian::Database::Internal::operator= ( const Internal  )  [private]

Assignment is not allowed.

void Xapian::Database::Internal::remove_spelling ( const string &  word,
Xapian::termcount  freqdec 
) const [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.

Parameters:
word The word to remove.
freqdec How much to decrease its frequency by.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 260 of file database.cc.

void Xapian::Database::Internal::remove_synonym ( const string &  term,
const string &  synonym 
) const [virtual]

Remove a synonym for a term.

If synonym isn't a synonym for term, then no action is taken.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, and ConstDatabaseWrapper.

Definition at line 290 of file database.cc.

void Xapian::Database::Internal::reopen (  )  [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 BrassDatabase, ChertDatabase, FlintDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 322 of file database.cc.

Xapian::docid Xapian::Database::Internal::replace_document ( const string &  unique_term,
const Xapian::Document document 
) [virtual]

Replace any documents matching a term.

See WritableDatabase::replace_document() for more information.

Reimplemented in ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 203 of file database.cc.

References add_document(), delete_document(), open_post_list(), and replace_document().

void Xapian::Database::Internal::replace_document ( Xapian::docid  did,
const Xapian::Document document 
) [virtual]

Replace a given document in the database.

See WritableDatabase::replace_document() for more information.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 196 of file database.cc.

References Assert.

Referenced by replace_document().

void Xapian::Database::Internal::request_document ( Xapian::docid   )  const [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 ConstDatabaseWrapper.

Definition at line 329 of file database.cc.

void Xapian::Database::Internal::set_metadata ( const string &  key,
const string &  value 
) [virtual]

Set the metadata associated with a given key.

See WritableDatabase::set_metadata() for more information.

Reimplemented in BrassWritableDatabase, ChertWritableDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

Definition at line 316 of file database.cc.

virtual bool Xapian::Database::Internal::term_exists ( const string &  tname  )  const [pure virtual]

Check whether a given term is in the database.

Parameters:
tname The term whose presence is being checked.

Implemented in BrassDatabase, BrassWritableDatabase, ChertDatabase, ChertWritableDatabase, FlintDatabase, FlintWritableDatabase, InMemoryDatabase, ConstDatabaseWrapper, and RemoteDatabase.

bool Xapian::Database::Internal::transaction_active (  )  const [inline, protected]

void Xapian::Database::Internal::write_changesets_to_fd ( int  fd,
const std::string &  start_revision,
bool  need_whole_db,
Xapian::ReplicationInfo info 
) [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 BrassDatabase, ChertDatabase, FlintDatabase, and ConstDatabaseWrapper.

Definition at line 343 of file database.cc.


Member Data Documentation


The documentation for this class was generated from the following files:

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.