#include <quartz_postlist.h>
Inheritance diagram for QuartzPostListTable:
Public Member Functions | |
QuartzPostListTable (string path_, bool readonly_) | |
Create a new table object. | |
void | merge_changes (const map< string, map< Xapian::docid, pair< char, Xapian::termcount > > > &mod_plists, const map< Xapian::docid, Xapian::termcount > &doclens, const map< string, pair< Xapian::termcount_diff, Xapian::termcount_diff > > &freq_deltas) |
Merge added, removed, and changed entries. | |
Xapian::docid | get_chunk (const string &tname, Xapian::docid did, bool adding, QPostlistChunkReader **from, QPostlistChunkWriter **to) |
Xapian::doccount | get_termfreq (const std::string &term) const |
Returns number of docs indexed by term. | |
Xapian::termcount | get_collection_freq (const std::string &term) const |
Returns the number of occurrences of term in the database. |
Definition at line 45 of file quartz_postlist.h.
QuartzPostListTable::QuartzPostListTable | ( | string | path_, | |
bool | readonly_ | |||
) | [inline] |
Create a new table object.
This does not create the table on disk - the create() method must be called before the table is created on disk
This also does not open the table - the open() method must be called before use is made of the table.
path_ | - Path at which the table is stored. | |
readonly_ | - whether to open the table for read only access. | |
blocksize_ | - Size of blocks to use. This parameter is only used when creating the table. |
Definition at line 61 of file quartz_postlist.h.
void QuartzPostListTable::merge_changes | ( | const map< string, map< Xapian::docid, pair< char, Xapian::termcount > > > & | mod_plists, | |
const map< Xapian::docid, Xapian::termcount > & | doclens, | |||
const map< string, pair< Xapian::termcount_diff, Xapian::termcount_diff > > & | freq_deltas | |||
) |
Merge added, removed, and changed entries.
Definition at line 1021 of file quartz_postlist.cc.
References QPostlistChunkWriter::append(), Assert, check_tname_in_key_lite(), Btree::cursor_get(), Btree::del(), QPostlistChunkWriter::flush(), get_chunk(), QPostlistChunkReader::get_docid(), QPostlistChunkReader::get_doclength(), Btree::get_exact_entry(), QPostlistChunkReader::get_wdf(), if(), QPostlistChunkReader::is_at_end(), make_key(), make_start_of_chunk(), make_start_of_first_chunk(), QPostlistChunkReader::next(), read_start_of_chunk(), and read_start_of_first_chunk().
Referenced by QuartzWritableDatabase::do_flush_const().
Xapian::docid QuartzPostListTable::get_chunk | ( | const string & | tname, | |
Xapian::docid | did, | |||
bool | adding, | |||
QPostlistChunkReader ** | from, | |||
QPostlistChunkWriter ** | to | |||
) |
Definition at line 940 of file quartz_postlist.cc.
References Assert, check_tname_in_key(), Btree::cursor_get(), make_key(), read_start_of_chunk(), read_start_of_first_chunk(), report_read_error(), and unpack_uint_preserving_sort().
Referenced by merge_changes().
Xapian::doccount QuartzPostListTable::get_termfreq | ( | const std::string & | term | ) | const |
Returns number of docs indexed by term.
This is the length of the postlist.
Referenced by QuartzDatabase::get_termfreq().
Xapian::termcount QuartzPostListTable::get_collection_freq | ( | const std::string & | term | ) | const |
Returns the number of occurrences of term in the database.
This is the sum of the wdfs in the postlist.
Referenced by QuartzDatabase::get_collection_freq(), and QuartzDatabase::get_termfreq().