21 #ifndef XAPIAN_INCLUDED_GLASS_SYNONYM_H
22 #define XAPIAN_INCLUDED_GLASS_SYNONYM_H
33 #include <string_view>
144 std::string_view prefix_)
Abstract base class for iterating all terms in a database.
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 rewind()
Position cursor on the dummy empty key.
void find_entry_lt(const string &key)
Position the cursor on the highest entry with key < key.
A backend designed for efficient indexing and retrieval, using compressed posting lists and a btree s...
GlassSynonymTable(const std::string &dbdir, bool readonly)
Create a new GlassSynonymTable object.
void clear_synonyms(std::string_view term)
Remove all synonyms for term.
std::set< std::string, std::less<> > last_synonyms
The synonyms for the last term which was updated.
std::string last_term
The last term which was updated.
GlassSynonymTable(int fd, off_t offset_, bool readonly)
void flush_db()
Override methods of GlassTable.
void add_synonym(std::string_view term, std::string_view synonym)
Add a synonym for term.
TermList * open_termlist(std::string_view term)
Open synonym termlist for a term.
void remove_synonym(std::string_view term, std::string_view synonym)
Remove a synonym for term.
bool is_modified() const
Override methods of GlassTable.
void cancel(const RootInfo &root_info, glass_revision_number_t rev)
Override methods of GlassTable.
GlassSynonymTermList(const GlassSynonymTermList &)
Copying is not allowed.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
TermList * skip_to(std::string_view tname)
Advance to the first term which is >= tname.
string prefix
The prefix to restrict the terms to.
~GlassSynonymTermList()
Destructor.
GlassCursor * cursor
A cursor which runs through the synonym table reading termnames from the keys.
void operator=(const GlassSynonymTermList &)
Assignment is not allowed.
Xapian::Internal::intrusive_ptr< const GlassDatabase > database
Keep a reference to our database to stop it being deleted.
GlassSynonymTermList(Xapian::Internal::intrusive_ptr< const GlassDatabase > database_, GlassCursor *cursor_, std::string_view prefix_)
TermList * next()
Advance to the next term in 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(const RootInfo &root_info, glass_revision_number_t rev)
Cancel any outstanding changes.
Abstract base class for termlists.
uint4 glass_revision_number_t
The revision number of a glass database.
Subclass of GlassTable for deriving lazy tables from.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Abstract base class for termlists.