21 #ifndef XAPIAN_INCLUDED_CHERT_SYNONYM_H
22 #define XAPIAN_INCLUDED_CHERT_SYNONYM_H
52 Z_DEFAULT_STRATEGY) { }
67 void add_synonym(
const std::string & term,
const std::string & synonym);
73 void remove_synonym(
const std::string & term,
const std::string & synonym);
134 const string & prefix_)
Abstract base class for iterating all terms in a database.
database class declarations
Subclass of ChertTable for deriving lazy tables from.
Abstract base class for iterating all terms in a database.
A cursor pointing to a position in a Btree table, for reading several entries in order,...
void find_entry_lt(const string &key)
Position the cursor on the highest entry with key < key.
bool find_entry(const string &key)
Position the cursor on the highest entry with key <= key.
ChertSynonymTable(const std::string &dbdir, bool readonly)
Create a new ChertSynonymTable object.
void remove_synonym(const std::string &term, const std::string &synonym)
Remove a synonym for term.
void clear_synonyms(const std::string &term)
Remove all synonyms for term.
void flush_db()
Override methods of ChertTable.
std::set< std::string > last_synonyms
The synonyms for the last term which was updated.
void cancel()
Override methods of ChertTable.
TermList * open_termlist(const std::string &term)
Open synonym termlist for a term.
void add_synonym(const std::string &term, const std::string &synonym)
Add a synonym for term.
bool is_modified() const
Override methods of ChertTable.
std::string last_term
The last term which was updated.
void operator=(const ChertSynonymTermList &)
Assignment is not allowed.
Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database
Keep a reference to our database to stop it being deleted.
string prefix
The prefix to restrict the terms to.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
string get_termname() const
Returns the current termname.
ChertCursor * cursor
A cursor which runs through the synonym table reading termnames from the keys.
TermList * skip_to(const string &tname)
Advance to the first term which is >= tname.
ChertSynonymTermList(const ChertSynonymTermList &)
Copying is not allowed.
TermList * next()
Advance to the next term in the list.
ChertSynonymTermList(Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database_, ChertCursor *cursor_, const string &prefix_)
~ChertSynonymTermList()
Destructor.
bool at_end() const
True if we're off the end of the list.
void flush_db()
Flush any outstanding changes to the DB file of the table.
bool is_modified() const
Determine whether the object contains uncommitted modifications.
void cancel()
Cancel any outstanding changes.
Abstract base class for termlists.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Abstract base class for termlists.