21 #ifndef XAPIAN_INCLUDED_GLASS_INVERTER_H
22 #define XAPIAN_INCLUDED_GLASS_INVERTER_H
81 pl_changes.insert(std::make_pair(did, new_wdf));
126 std::map<std::string, std::map<Xapian::docid, std::string>>
pos_changes;
130 const std::string & tname,
131 const std::vector<Xapian::termpos> & posvec,
135 const std::string & term,
136 const std::string & s);
145 std::map<std::string, PostingChanges>::iterator i;
151 i->second.add_posting(did, wdf);
157 std::map<std::string, PostingChanges>::iterator i;
163 i->second.remove_posting(did, wdf);
170 std::map<std::string, PostingChanges>::iterator i;
176 i->second.update_posting(did, old_wdf, new_wdf);
182 const std::string & tname,
184 bool modifying =
false);
187 const std::string & term);
190 const std::string & term,
191 std::string & s)
const;
215 std::map<Xapian::docid, Xapian::termcount>::const_iterator i;
246 std::map<std::string, PostingChanges>::const_iterator i;
251 tf_delta = i->second.get_tfdelta();
252 cf_delta = i->second.get_cfdelta();
void add(const std::string &key, const std::string &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_diff get_cfdelta() const
Get the collection frequency delta.
Xapian::termcount_diff get_tfdelta() const
Get the term frequency delta.
void remove_posting(Xapian::docid did, Xapian::termcount wdf)
Remove a posting.
PostingChanges(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Constructor for an updated posting.
Xapian::termcount_diff cf_delta
Change in collection frequency.
PostingChanges(Xapian::docid did, Xapian::termcount wdf)
Constructor for an added posting.
void update_posting(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Update a posting.
Xapian::termcount_diff tf_delta
Change in term frequency,.
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".
bool get_positionlist(Xapian::docid did, const std::string &term, std::string &s) const
bool get_deltas(const std::string &term, Xapian::termcount_diff &tf_delta, Xapian::termcount_diff &cf_delta) const
void delete_doclength(Xapian::docid did)
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 > postlist_changes
Buffered changes to postlists.
void set_positionlist(Xapian::docid did, const std::string &term, const std::string &s)
void delete_positionlist(Xapian::docid did, const std::string &term)
bool has_positions(const GlassPositionListTable &position_table) const
void flush_post_lists(GlassPostListTable &table, const std::string &pfx)
Flush postlist changes for all terms which start with pfx.
void flush_post_list(GlassPostListTable &table, const std::string &term)
Flush postlist changes for term.
int has_positions_cache
Cached answer to Inverter::has_positions().
bool get_doclength(Xapian::docid did, Xapian::termcount &doclen) const
std::map< std::string, std::map< Xapian::docid, std::string > > pos_changes
Buffered changes to positional data.
void set_doclength(Xapian::docid did, Xapian::termcount doclen, bool add)
void flush_doclengths(GlassPostListTable &table)
Flush document length changes.
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.
void store_positions(const GlassPositionListTable &position_table, Xapian::docid did, const std::string &tname, const std::vector< Xapian::termpos > &posvec, bool modifying)
Indicates an attempt to access a document not present in the database.
Class for iterating over a list of terms.
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.
XAPIAN_TERMCOUNT_BASE_TYPE termcount_diff
A signed difference between two counts of terms.
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.
Various assertion macros.
Convert types to std::string.