40 bool throw_if_not_present)
41 : db(db_), did(did_), current_wdf(0), current_termfreq(0)
43 LOGCALL_CTOR(DB,
"GlassTermList", db_ | did_ | throw_if_not_present);
47 if (!throw_if_not_present) {
67 msg =
"Too little data for doclen in termlist";
69 msg =
"Overflowed value for doclen in termlist";
78 msg =
"Too little data for list size in termlist";
80 msg =
"Overflowed value for list size in termlist";
113 LOGCALL_VOID(DB,
"GlassTermList::accumulate_stats", stats);
147 bool wdf_in_reuse =
false;
150 size_t len =
static_cast<unsigned char>(*
pos++);
162 size_t append_len =
static_cast<unsigned char>(*
pos++);
170 msg =
"Too little data for wdf in termlist";
172 msg =
"Overflowed value for wdf in termlist";
205 #ifdef DISABLE_GPL_LIBXAPIAN
206 # error GPL source we cannot relicense included in libxapian
void get_freqs(std::string_view term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const
Returns frequencies for a term.
PositionList * open_position_list(Xapian::docid did, std::string_view term) const
GlassTermListTable termlist_table
Table storing term lists.
Xapian::doccount get_doccount() const
Virtual methods of Database::Internal.
virtual Xapian::termcount positionlist_count(Xapian::docid did, std::string_view term) const
bool get_exact_entry(std::string_view key, std::string &tag) const
Read an entry from the table, if and only if it is exactly that being asked for.
static std::string make_key(Xapian::docid did)
Xapian::termcount get_doclength() const
Return the length of this document.
Xapian::termcount get_unique_terms() const
Return the number of unique terms.
Xapian::termcount termlist_size
The number of entries in this termlist.
std::string data
The tag value from the termlist table which holds the encoded termlist.
PositionList * positionlist_begin() const
Return a PositionIterator for the current position.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * next()
Advance the current position to the next term in the termlist.
TermList * skip_to(std::string_view term)
Skip forward to the specified term.
Xapian::termcount current_wdf
The wdf for the term at the current position.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::docid did
The document id that this TermList is for.
const char * end
Pointer to the end of the encoded tag value.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
Xapian::doccount current_termfreq
The term frequency for the term at the current position.
Xapian::Internal::intrusive_ptr< const GlassDatabase > db
The database we're reading data from.
const char * pos
Current position with the encoded tag value held in data.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
GlassTermList(const GlassTermList &)
Don't allow copying.
Xapian::termcount doclen
The length of document did.
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
DatabaseCorruptError indicates database corruption was detected.
Indicates an attempt to access a document not present in the database.
Collates statistics while calculating term weight in an ESet.
void accumulate(size_t shard_index, Xapian::termcount wdf, Xapian::termcount doclen, Xapian::doccount subtf, Xapian::doccount subdbsize)
A smart pointer that uses intrusive reference counting.
Abstract base class for iterating term positions in a document.
Abstract base class for termlists.
std::string current_term
The current term.
size_t shard_index
Which shard of a multidatabase this is from.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
Hierarchy of classes which Xapian can throw as exceptions.
Collate statistics and calculate the term weights for the ESet.
A position list in a glass database.
A TermList in a glass database.
string str(int value)
Convert int to std::string.
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.
Pack types into strings and unpack them again.
bool unpack_uint(const char **p, const char *end, U *result)
Decode an unsigned integer from a string.
Convert types to std::string.