xapian-core  1.4.27
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Inverter Class Reference

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

#include <glass_inverter.h>

+ Collaboration diagram for Inverter:

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 GlassPositionListTable &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 GlassPositionListTable &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 (GlassPostListTable &table)
 Flush document length changes. More...
 
void flush_post_list (GlassPostListTable &table, const std::string &term)
 Flush postlist changes for term. More...
 
void flush_all_post_lists (GlassPostListTable &table)
 Flush postlist changes for all terms. More...
 
void flush_post_lists (GlassPostListTable &table, const std::string &pfx)
 Flush postlist changes for all terms which start with pfx. More...
 
void flush (GlassPostListTable &table)
 Flush all postlist table changes. More...
 
void flush_pos_lists (GlassPositionListTable &table)
 Flush position changes. More...
 
bool get_deltas (const std::string &term, Xapian::termcount_diff &tf_delta, Xapian::termcount_diff &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 GlassPositionListTable &position_table, Xapian::docid did, const std::string &tname, const std::vector< 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, PostingChangespostlist_changes
 Buffered changes to postlists. More...
 
int has_positions_cache = -1
 Cached answer to Inverter::has_positions(). More...
 
std::map< std::string, std::map< Xapian::docid, std::string > > pos_changes
 Buffered changes to positional data. More...
 

Friends

class GlassPostListTable
 

Detailed Description

Class which "inverts the file".

Definition at line 45 of file glass_inverter.h.

Member Function Documentation

◆ add_posting()

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

◆ clear()

void Inverter::clear ( )
inline

Definition at line 195 of file glass_inverter.h.

Referenced by GlassWritableDatabase::cancel().

◆ delete_doclength()

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

Definition at line 209 of file glass_inverter.h.

References Assert, and DELETED_POSTING.

Referenced by GlassWritableDatabase::delete_document().

◆ delete_positionlist()

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

◆ flush()

void Inverter::flush ( GlassPostListTable table)

Flush all postlist table changes.

Definition at line 216 of file glass_inverter.cc.

Referenced by GlassWritableDatabase::flush_postlist_changes().

◆ flush_all_post_lists()

void Inverter::flush_all_post_lists ( GlassPostListTable table)

Flush postlist changes for all terms.

Definition at line 175 of file glass_inverter.cc.

References GlassPostListTable::merge_changes().

◆ flush_doclengths()

void Inverter::flush_doclengths ( GlassPostListTable table)

Flush document length changes.

Definition at line 156 of file glass_inverter.cc.

References GlassPostListTable::merge_doclen_changes().

Referenced by GlassWritableDatabase::open_post_list().

◆ flush_pos_lists()

void Inverter::flush_pos_lists ( GlassPositionListTable table)

◆ flush_post_list()

void Inverter::flush_post_list ( GlassPostListTable table,
const std::string &  term 
)

Flush postlist changes for term.

Definition at line 163 of file glass_inverter.cc.

References GlassPostListTable::merge_changes().

Referenced by GlassWritableDatabase::open_post_list().

◆ flush_post_lists()

void Inverter::flush_post_lists ( GlassPostListTable table,
const std::string &  pfx 
)

Flush postlist changes for all terms which start with pfx.

Definition at line 185 of file glass_inverter.cc.

References GlassPostListTable::merge_changes().

Referenced by GlassWritableDatabase::open_allterms().

◆ get_deltas()

bool Inverter::get_deltas ( const std::string &  term,
Xapian::termcount_diff tf_delta,
Xapian::termcount_diff cf_delta 
) const
inline

Definition at line 243 of file glass_inverter.h.

Referenced by GlassWritableDatabase::get_freqs().

◆ get_doclength()

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

◆ get_positionlist()

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

◆ has_positions()

bool Inverter::has_positions ( const GlassPositionListTable position_table) const

Definition at line 133 of file glass_inverter.cc.

References GlassTable::get_entry_count().

Referenced by GlassWritableDatabase::has_positions().

◆ remove_posting()

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

◆ set_doclength()

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

◆ set_positionlist() [1/2]

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

◆ set_positionlist() [2/2]

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

◆ store_positions()

void Inverter::store_positions ( const GlassPositionListTable position_table,
Xapian::docid  did,
const std::string &  tname,
const std::vector< Xapian::termpos > &  posvec,
bool  modifying 
)
private

◆ update_posting()

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

Definition at line 167 of file glass_inverter.h.

Referenced by GlassWritableDatabase::replace_document().

Friends And Related Function Documentation

◆ GlassPostListTable

friend class GlassPostListTable
friend

Definition at line 46 of file glass_inverter.h.

Member Data Documentation

◆ doclen_changes

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

Buffered changes to document lengths.

Definition at line 140 of file glass_inverter.h.

◆ has_positions_cache

int Inverter::has_positions_cache = -1
mutableprivate

Cached answer to Inverter::has_positions().

-1: needs calculating 0: false 1: true

Definition at line 123 of file glass_inverter.h.

◆ pos_changes

std::map<std::string, std::map<Xapian::docid, std::string> > Inverter::pos_changes
private

Buffered changes to positional data.

Definition at line 126 of file glass_inverter.h.

◆ postlist_changes

std::map<std::string, PostingChanges> Inverter::postlist_changes
private

Buffered changes to postlists.

Definition at line 115 of file glass_inverter.h.


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