21 #ifndef XAPIAN_INCLUDED_GLASS_INVERTER_H
22 #define XAPIAN_INCLUDED_GLASS_INVERTER_H
30 #include <string_view>
93 pl_changes.insert(std::make_pair(did, new_wdf));
140 std::map<std::string,
141 std::map<Xapian::docid, std::string>,
146 std::string_view tname,
151 std::string_view
term,
166 i->second.add_posting(did, wdf);
177 i->second.remove_posting(did, wdf);
189 i->second.update_posting(did, old_wdf, new_wdf);
195 std::string_view tname,
197 bool modifying =
false);
200 std::string_view
term);
203 std::string_view
term,
204 std::string & s)
const;
262 tf_delta = i->second.get_tfdelta();
263 cf_delta = i->second.get_cfdelta();
void add(std::string_view key, std::string_view tag, bool already_compressed=false)
Add a key/tag pair to the table, replacing any existing pair with the same key.
Class for storing the changes in frequencies for a term.
Xapian::termcount get_tfdelta() const
Get the term frequency delta.
void remove_posting(Xapian::docid did, Xapian::termcount wdf)
Remove a posting.
Xapian::termcount tf_delta
Change in term frequency.
PostingChanges(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Constructor for an updated posting.
PostingChanges(Xapian::docid did, Xapian::termcount wdf)
Constructor for an added posting.
Xapian::termcount get_cfdelta() const
Get the collection frequency delta.
Xapian::termcount cf_delta
Change in collection frequency.
void update_posting(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Update a posting.
PostingChanges(Xapian::docid did, Xapian::termcount wdf, bool)
Constructor for a removed posting.
std::map< Xapian::docid, Xapian::termcount > pl_changes
Changes to this term's postlist.
void add_posting(Xapian::docid did, Xapian::termcount wdf)
Add a posting.
Class which "inverts the file".
std::map< std::string, std::map< Xapian::docid, std::string >, std::less<> > pos_changes
Buffered changes to positional data.
bool get_deltas(std::string_view term, Xapian::termcount &tf_delta, Xapian::termcount &cf_delta) const
void delete_doclength(Xapian::docid did)
void flush_post_list(GlassPostListTable &table, std::string_view term)
Flush postlist changes for term.
void remove_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
void flush_all_post_lists(GlassPostListTable &table)
Flush postlist changes for all terms.
void update_posting(Xapian::docid did, const std::string &term, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
std::map< std::string, PostingChanges, std::less<> > postlist_changes
Buffered changes to postlists.
bool get_positionlist(Xapian::docid did, std::string_view term, std::string &s) const
void store_positions(const GlassPositionListTable &position_table, Xapian::docid did, std::string_view tname, const Xapian::VecCOW< Xapian::termpos > &posvec, bool modifying)
bool has_positions(const GlassPositionListTable &position_table) const
void delete_positionlist(Xapian::docid did, std::string_view term)
void set_positionlist(Xapian::docid did, std::string_view term, std::string_view s)
int has_positions_cache
Cached answer to Inverter::has_positions().
bool get_doclength(Xapian::docid did, Xapian::termcount &doclen) const
void set_doclength(Xapian::docid did, Xapian::termcount doclen, bool add)
void flush_doclengths(GlassPostListTable &table)
Flush document length changes.
void flush_post_lists(GlassPostListTable &table, std::string_view pfx)
Flush postlist changes for all terms which start with pfx.
void add_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
std::map< Xapian::docid, Xapian::termcount > doclen_changes
Buffered changes to document lengths.
void flush_pos_lists(GlassPositionListTable &table)
Flush position changes.
void flush(GlassPostListTable &table)
Flush all postlist table changes.
Indicates an attempt to access a document not present in the database.
Class for iterating over a list of terms.
Suitable for "simple" type T.
#define UNSIGNED_OVERFLOW_OK(X)
Hierarchy of classes which Xapian can throw as exceptions.
const Xapian::termcount DELETED_POSTING
Magic wdf value used for a deleted posting.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Negate unsigned integer, avoiding compiler warnings.
constexpr std::enable_if_t< std::is_unsigned_v< T >, T > negate_unsigned(T value)
Various assertion macros.
Custom vector implementations using small vector optimisation.
Convert types to std::string.