25 #ifndef OM_HGUARD_DATABASE_H
26 #define OM_HGUARD_DATABASE_H
53 struct ReplicationInfo;
273 const string & tname)
const = 0;
350 virtual void add_synonym(
const string & term,
const string & synonym)
const;
356 virtual void remove_synonym(
const string & term,
const string & synonym)
const;
384 virtual void set_metadata(
const string & key,
const string & value);
481 const std::string & start_revision,
536 virtual bool locked()
const;
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
Xapian::TermIterator::Internal TermList
Xapian::PositionIterator::Internal PositionList
Xapian::ValueIterator::Internal ValueList
Abstract base class for leaf postlists.
RemoteDatabase is the baseclass for remote database implementations.
Base class for databases.
virtual Xapian::totallength get_total_length() const =0
Return the total length of all documents in this database.
void dtor_called()
Internal method to perform cleanup when a writable database is destroyed with uncommitted changes.
virtual Xapian::termcount get_doclength_lower_bound() const
Get a lower bound on the length of a document in this DB.
enum Xapian::Database::Internal::@2 transaction_state
Transaction state.
virtual void commit()
Commit pending modifications to the database.
virtual ~Internal()
Destroy the database.
virtual void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
virtual LeafPostList * open_post_list(const string &tname) const =0
Open a posting list.
void begin_transaction(bool flushed)
Begin a transaction.
Internal(const Internal &)
Copies are not allowed.
virtual string get_uuid() const
Get a UUID for the database.
virtual void close()=0
Close the database.
virtual Xapian::Document::Internal * collect_document(Xapian::docid did) const
virtual TermList * open_spelling_wordlist() const
Return a termlist which returns the words which are spelling correction targets.
virtual int get_backend_info(string *path) const =0
Get backend information about this database.
virtual void get_freqs(const string &term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const =0
Returns frequencies for a term.
virtual void request_document(Xapian::docid) const
Request and later collect a document from the database.
virtual void delete_document(Xapian::docid did)
Delete a document in the database.
virtual Xapian::termcount get_wdf_upper_bound(const std::string &term) const
Get an upper bound on the wdf of term term.
virtual Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
virtual void cancel()
Cancel pending modifications to the database.
virtual TermList * open_metadata_keylist(const std::string &prefix) const
Open a termlist returning each metadata key.
virtual void clear_synonyms(const string &term) const
Clear all synonyms for a term.
void commit_transaction()
Commit a transaction.
virtual TermList * open_spelling_termlist(const string &word) const
Create a termlist tree from trigrams of word.
virtual void remove_synonym(const string &term, const string &synonym) const
Remove a synonym for a term.
virtual void add_synonym(const string &term, const string &synonym) const
Add a synonym for a term.
void operator=(const Internal &)
Assignment is not allowed.
virtual string get_metadata(const string &key) const
Get the metadata associated with a given key.
virtual void set_metadata(const string &key, const string &value)
Set the metadata associated with a given key.
virtual Xapian::doccount get_value_freq(Xapian::valueno slot) const =0
Return the frequency of a given value slot.
virtual void add_spelling(const string &word, Xapian::termcount freqinc) const
Add a word to the spelling dictionary.
virtual bool term_exists(const string &tname) const =0
Check whether a given term is in the database.
Internal()
Create a database - called only by derived classes.
virtual bool has_positions() const =0
Check whether this database contains any positional information.
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.
virtual void get_used_docid_range(Xapian::docid &first, Xapian::docid &last) const
Find lowest and highest docids actually in use.
virtual Xapian::docid get_lastdocid() const =0
Return the last used document id of this (sub) database.
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.
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.
virtual void invalidate_doc_object(Xapian::Document::Internal *obj) const
Notify the database that document is no longer valid.
bool transaction_active() const
virtual Xapian::Document::Internal * open_document(Xapian::docid did, bool lazy) const =0
Open a document.
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.
virtual void remove_spelling(const string &word, Xapian::termcount freqdec) const
Remove a word from the spelling dictionary.
virtual TermList * open_allterms(const string &prefix) const =0
Open an allterms list.
virtual Xapian::doccount get_spelling_frequency(const string &word) const
Return the number of times word was added as a spelling.
@ TRANSACTION_UNIMPLEMENTED
virtual Xapian::termcount get_doclength(Xapian::docid did) const =0
Get the length of a given document.
virtual bool locked() const
Return true if the database is open for writing.
virtual TermList * open_synonym_termlist(const string &term) const
Open a termlist returning synonyms for 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 TermList * open_synonym_keylist(const string &prefix) const
Open a termlist returning each term which has synonyms.
virtual string get_revision_info() const
Get a string describing the current revision of the database.
virtual void keep_alive()
Send a keep-alive signal to a remote database, to stop it from timing out.
virtual bool reopen()
Reopen the database to the latest available revision.
virtual Xapian::termcount get_doclength_upper_bound() const
Get an upper bound on the length of a document in this DB.
void cancel_transaction()
Cancel a transaction.
virtual Xapian::termcount get_unique_terms(Xapian::docid did) const =0
Get the number of unique term in document.
virtual TermList * open_term_list(Xapian::docid did) const =0
Open a term list.
virtual ValueList * open_value_list(Xapian::valueno slot) const
Open a value stream.
A document in the database, possibly plus modifications.
A handle representing a document in a Xapian database.
Base class for objects managed by intrusive_ptr.
Abstract base class for iterating term positions in a document.
Class representing a query.
Abstract base class for termlists.
Abstract base class for value streams.
API for working with Xapian databases.
API for working with documents.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
Class for iterating over term positions.
Information about the steps involved in performing a replication.
Class for iterating over a list of terms.
Class for iterating over document values.