xapian-core  2.0.0
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
HoneyInverter Class Reference

Class which "inverts the file". More...

#include <honey_inverter.h>

+ Collaboration diagram for HoneyInverter:

Classes

class  PostingChanges
 Class for storing the changes in frequencies for a term. More...
 

Public Member Functions

void add_posting (Xapian::docid did, const std::string &term, Xapian::doccount wdf)
 
void remove_posting (Xapian::docid did, const std::string &term, Xapian::doccount wdf)
 
void update_posting (Xapian::docid did, const std::string &term, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
 
void set_positionlist (const HoneyPositionTable &position_table, Xapian::docid did, const std::string &tname, const Xapian::TermIterator &term, bool modifying=false)
 
void delete_positionlist (Xapian::docid did, const std::string &term)
 
bool get_positionlist (Xapian::docid did, const std::string &term, std::string &s) const
 
bool has_positions (const HoneyPositionTable &position_table) const
 
void clear ()
 
void set_doclength (Xapian::docid did, Xapian::termcount doclen, bool add)
 
void delete_doclength (Xapian::docid did)
 
bool get_doclength (Xapian::docid did, Xapian::termcount &doclen) const
 
void flush_doclengths (HoneyPostListTable &table)
 Flush document length changes. More...
 
void flush_post_list (HoneyPostListTable &table, const std::string &term)
 Flush postlist changes for term. More...
 
void flush_all_post_lists (HoneyPostListTable &table)
 Flush postlist changes for all terms. More...
 
void flush_post_lists (HoneyPostListTable &table, const std::string &pfx)
 Flush postlist changes for all terms which start with pfx. More...
 
void flush (HoneyPostListTable &table)
 Flush all postlist table changes. More...
 
void flush_pos_lists (HoneyPositionTable &table)
 Flush position changes. More...
 
bool get_deltas (std::string_view term, Xapian::termcount &tf_delta, Xapian::termcount &cf_delta) const
 

Public Attributes

std::map< Xapian::docid, Xapian::termcountdoclen_changes
 Buffered changes to document lengths. More...
 

Private Member Functions

void store_positions (const HoneyPositionTable &position_table, Xapian::docid did, const std::string &tname, const Xapian::VecCOW< Xapian::termpos > &posvec, bool modifying)
 
void set_positionlist (Xapian::docid did, const std::string &term, const std::string &s)
 

Private Attributes

std::map< std::string, PostingChanges, std::less<> > postlist_changes
 Buffered changes to postlists. More...
 
std::map< std::string, std::map< Xapian::docid, std::string >, std::less<> > pos_changes
 Buffered changes to positional data. More...
 

Static Private Attributes

static const Xapian::termcount DELETED_POSTING = Xapian::termcount(-1)
 Magic wdf value used for a deleted posting. More...
 

Friends

class HoneyPostListTable
 

Detailed Description

Class which "inverts the file".

Definition at line 45 of file honey_inverter.h.

Member Function Documentation

◆ add_posting()

void HoneyInverter::add_posting ( Xapian::docid  did,
const std::string &  term,
Xapian::doccount  wdf 
)
inline

Definition at line 150 of file honey_inverter.h.

References postlist_changes, and term.

◆ clear()

void HoneyInverter::clear ( )
inline

Definition at line 199 of file honey_inverter.h.

References doclen_changes, pos_changes, and postlist_changes.

◆ delete_doclength()

void HoneyInverter::delete_doclength ( Xapian::docid  did)
inline

Definition at line 213 of file honey_inverter.h.

References Assert, DELETED_POSTING, and doclen_changes.

◆ delete_positionlist()

void HoneyInverter::delete_positionlist ( Xapian::docid  did,
const std::string &  term 
)

Definition at line 107 of file honey_inverter.cc.

References term.

◆ flush()

void HoneyInverter::flush ( HoneyPostListTable table)

Flush all postlist table changes.

Definition at line 211 of file honey_inverter.cc.

◆ flush_all_post_lists()

void HoneyInverter::flush_all_post_lists ( HoneyPostListTable table)

Flush postlist changes for all terms.

Definition at line 171 of file honey_inverter.cc.

References HoneyPostListTable::merge_changes().

◆ flush_doclengths()

void HoneyInverter::flush_doclengths ( HoneyPostListTable table)

Flush document length changes.

Definition at line 153 of file honey_inverter.cc.

References HoneyPostListTable::merge_doclen_changes().

◆ flush_pos_lists()

void HoneyInverter::flush_pos_lists ( HoneyPositionTable table)

Flush position changes.

Definition at line 218 of file honey_inverter.cc.

References HoneyPositionTable::delete_positionlist(), HoneyPositionTable::set_positionlist(), and term.

◆ flush_post_list()

void HoneyInverter::flush_post_list ( HoneyPostListTable table,
const std::string &  term 
)

Flush postlist changes for term.

Definition at line 160 of file honey_inverter.cc.

References HoneyPostListTable::merge_changes(), and term.

◆ flush_post_lists()

void HoneyInverter::flush_post_lists ( HoneyPostListTable table,
const std::string &  pfx 
)

Flush postlist changes for all terms which start with pfx.

Definition at line 180 of file honey_inverter.cc.

References HoneyPostListTable::merge_changes().

◆ get_deltas()

bool HoneyInverter::get_deltas ( std::string_view  term,
Xapian::termcount tf_delta,
Xapian::termcount cf_delta 
) const
inline

Definition at line 247 of file honey_inverter.h.

References postlist_changes, and term.

◆ get_doclength()

bool HoneyInverter::get_doclength ( Xapian::docid  did,
Xapian::termcount doclen 
) const
inline

Definition at line 219 of file honey_inverter.h.

References DELETED_POSTING, doclen_changes, rare, and Xapian::Internal::str().

◆ get_positionlist()

bool HoneyInverter::get_positionlist ( Xapian::docid  did,
const std::string &  term,
std::string &  s 
) const

Definition at line 114 of file honey_inverter.cc.

References term.

◆ has_positions()

bool HoneyInverter::has_positions ( const HoneyPositionTable position_table) const

Definition at line 130 of file honey_inverter.cc.

References HoneyTable::empty(), and HoneyTable::get_entry_count().

◆ remove_posting()

void HoneyInverter::remove_posting ( Xapian::docid  did,
const std::string &  term,
Xapian::doccount  wdf 
)
inline

Definition at line 161 of file honey_inverter.h.

References postlist_changes, and term.

◆ set_doclength()

void HoneyInverter::set_doclength ( Xapian::docid  did,
Xapian::termcount  doclen,
bool  add 
)
inline

Definition at line 205 of file honey_inverter.h.

References HoneyTable::add(), Assert, DELETED_POSTING, and doclen_changes.

◆ set_positionlist() [1/2]

void HoneyInverter::set_positionlist ( const HoneyPositionTable position_table,
Xapian::docid  did,
const std::string &  tname,
const Xapian::TermIterator term,
bool  modifying = false 
)

◆ set_positionlist() [2/2]

void HoneyInverter::set_positionlist ( Xapian::docid  did,
const std::string &  term,
const std::string &  s 
)
private

Definition at line 98 of file honey_inverter.cc.

References term.

◆ store_positions()

void HoneyInverter::store_positions ( const HoneyPositionTable position_table,
Xapian::docid  did,
const std::string &  tname,
const Xapian::VecCOW< Xapian::termpos > &  posvec,
bool  modifying 
)
private

◆ update_posting()

void HoneyInverter::update_posting ( Xapian::docid  did,
const std::string &  term,
Xapian::termcount  old_wdf,
Xapian::termcount  new_wdf 
)
inline

Definition at line 172 of file honey_inverter.h.

References postlist_changes, and term.

Friends And Related Function Documentation

◆ HoneyPostListTable

friend class HoneyPostListTable
friend

Definition at line 46 of file honey_inverter.h.

Member Data Documentation

◆ DELETED_POSTING

const Xapian::termcount HoneyInverter::DELETED_POSTING = Xapian::termcount(-1)
staticprivate

◆ doclen_changes

std::map<Xapian::docid, Xapian::termcount> HoneyInverter::doclen_changes

Buffered changes to document lengths.

Definition at line 147 of file honey_inverter.h.

Referenced by clear(), delete_doclength(), get_doclength(), and set_doclength().

◆ pos_changes

std::map<std::string, std::map<Xapian::docid, std::string>, std::less<> > HoneyInverter::pos_changes
private

Buffered changes to positional data.

Definition at line 133 of file honey_inverter.h.

Referenced by clear().

◆ postlist_changes

std::map<std::string, PostingChanges, std::less<> > HoneyInverter::postlist_changes
private

Buffered changes to postlists.

Definition at line 128 of file honey_inverter.h.

Referenced by add_posting(), clear(), get_deltas(), remove_posting(), and update_posting().


The documentation for this class was generated from the following files: