#include <flint_postlist.h>
Inheritance diagram for FlintPostListTable:
Public Member Functions | |
FlintPostListTable (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, PostlistChunkReader **from, PostlistChunkWriter **to) |
bool | term_exists (const string &term) const |
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. | |
Static Public Member Functions | |
static string | make_key (const string &term, Xapian::docid did) |
Compose a key from a termname and docid. | |
static string | make_key (const string &term) |
Compose a key from a termname. |
Definition at line 47 of file flint_postlist.h.
FlintPostListTable::FlintPostListTable | ( | 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. |
Definition at line 61 of file flint_postlist.h.
void FlintPostListTable::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 994 of file flint_postlist.cc.
References PostlistChunkWriter::append(), Assert, check_tname_in_key_lite(), FlintTable::cursor_get(), DEBUGCALL, DEBUGLINE, FlintTable::del(), PostlistChunkWriter::flush(), get_chunk(), PostlistChunkReader::get_docid(), PostlistChunkReader::get_doclength(), FlintTable::get_exact_entry(), PostlistChunkReader::get_wdf(), PostlistChunkReader::is_at_end(), make_key(), make_start_of_chunk(), make_start_of_first_chunk(), PostlistChunkReader::next(), read_start_of_chunk(), and read_start_of_first_chunk().
Referenced by FlintWritableDatabase::flush_postlist_changes().
Xapian::docid FlintPostListTable::get_chunk | ( | const string & | tname, | |
Xapian::docid | did, | |||
bool | adding, | |||
PostlistChunkReader ** | from, | |||
PostlistChunkWriter ** | to | |||
) |
Definition at line 914 of file flint_postlist.cc.
References Assert, check_tname_in_key(), FlintTable::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().
static string FlintPostListTable::make_key | ( | const string & | term, | |
Xapian::docid | did | |||
) | [inline, static] |
Compose a key from a termname and docid.
Definition at line 75 of file flint_postlist.h.
References pack_string_preserving_sort(), and pack_uint_preserving_sort().
Referenced by PostlistChunkWriter::append(), FlintPostList::FlintPostList(), PostlistChunkWriter::flush(), get_chunk(), merge_changes(), FlintPostList::move_to_chunk_containing(), and term_exists().
static string FlintPostListTable::make_key | ( | const string & | term | ) | [inline, static] |
Compose a key from a termname.
Definition at line 82 of file flint_postlist.h.
References pack_string_preserving_sort().
bool FlintPostListTable::term_exists | ( | const string & | term | ) | const [inline] |
Definition at line 86 of file flint_postlist.h.
References FlintTable::key_exists(), and make_key().
Referenced by FlintDatabase::term_exists().
Xapian::doccount FlintPostListTable::get_termfreq | ( | const std::string & | term | ) | const |
Returns number of docs indexed by term.
This is the length of the postlist.
Referenced by FlintDatabase::get_termfreq().
Xapian::termcount FlintPostListTable::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 FlintDatabase::get_collection_freq().