xapian-core
1.4.27
|
A TermList in a chert database. More...
#include <chert_termlist.h>
Public Member Functions | |
ChertTermList (Xapian::Internal::intrusive_ptr< const ChertDatabase > db_, Xapian::docid did_) | |
Create a new ChertTermList object for document did_ in DB db_. More... | |
chert_doclen_t | get_doclength () const |
Return the length of this document. More... | |
Xapian::termcount | get_approx_size () const |
Return approximate size of this termlist. More... | |
void | accumulate_stats (Xapian::Internal::ExpandStats &stats) const |
Collate weighting information for the current term. More... | |
std::string | get_termname () const |
Return the termname at the current position. More... | |
Xapian::termcount | get_wdf () const |
Return the wdf for the term at the current position. More... | |
Xapian::doccount | get_termfreq () const |
Return the term frequency for the term at the current position. More... | |
TermList * | next () |
Advance the current position to the next term in the termlist. More... | |
TermList * | skip_to (const std::string &term) |
Skip forward to the specified term. More... | |
bool | at_end () const |
Return true if the current position is past the last term in this list. More... | |
Xapian::termcount | positionlist_count () const |
Return the length of the position list for the current position. More... | |
Xapian::PositionIterator | positionlist_begin () const |
Return a PositionIterator for the current position. More... | |
Public Member Functions inherited from Xapian::TermIterator::Internal | |
virtual | ~Internal () |
We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More... | |
virtual const std::vector< Xapian::termpos > * | get_vector_termpos () const |
Get pointer to vector<termpos> if that's the internal representation. More... | |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
intrusive_base () | |
Construct with no references. More... | |
Private Member Functions | |
void | operator= (const ChertTermList &) |
Don't allow assignment. More... | |
ChertTermList (const ChertTermList &) | |
Don't allow copying. More... | |
Private Attributes | |
Xapian::Internal::intrusive_ptr< const ChertDatabase > | db |
The database we're reading data from. More... | |
Xapian::docid | did |
The document id that this TermList is for. More... | |
chert_doclen_t | doclen |
The length of document did. More... | |
Xapian::termcount | termlist_size |
The number of entries in this termlist. More... | |
std::string | data |
The tag value from the termlist table which holds the encoded termlist. More... | |
const char * | pos |
Current position with the encoded tag value held in data. More... | |
const char * | end |
Pointer to the end of the encoded tag value. More... | |
std::string | current_term |
The termname at the current position. More... | |
Xapian::termcount | current_wdf |
The wdf for the term at the current position. More... | |
Xapian::doccount | current_termfreq |
The term frequency for the term at the current position. More... | |
Additional Inherited Members | |
Public Attributes inherited from Xapian::TermIterator::Internal | |
size_t | shard_index = 0 |
Which shard of a multidatabase this is from. More... | |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
unsigned | _refs |
Reference count. More... | |
Protected Member Functions inherited from Xapian::TermIterator::Internal | |
Internal () | |
Only constructable as a base class for derived classes. More... | |
A TermList in a chert database.
Definition at line 41 of file chert_termlist.h.
|
private |
Don't allow copying.
ChertTermList::ChertTermList | ( | Xapian::Internal::intrusive_ptr< const ChertDatabase > | db_, |
Xapian::docid | did_ | ||
) |
Create a new ChertTermList object for document did_ in DB db_.
Definition at line 38 of file chert_termlist.cc.
References data, db, did, doclen, end, ChertTable::get_exact_entry(), LOGCALL_CTOR, ChertTermListTable::make_key(), pos, Xapian::Internal::str(), termlist_size, ChertDatabase::termlist_table, and unpack_uint().
|
virtual |
Collate weighting information for the current term.
Reimplemented from Xapian::TermIterator::Internal.
Definition at line 95 of file chert_termlist.cc.
References Xapian::Internal::ExpandStats::accumulate(), Assert, at_end(), current_wdf, db, doclen, ChertDatabase::get_doccount(), get_termfreq(), LOGCALL_VOID, and Xapian::TermIterator::Internal::shard_index.
|
virtual |
Return true if the current position is past the last term in this list.
Implements Xapian::TermIterator::Internal.
Definition at line 183 of file chert_termlist.cc.
References LOGCALL, pos, and RETURN.
Referenced by accumulate_stats(), ChertWritableDatabase::delete_document(), next(), and ChertWritableDatabase::replace_document().
|
virtual |
Return approximate size of this termlist.
For a ChertTermList, this value will always be exact.
Implements Xapian::TermIterator::Internal.
Definition at line 88 of file chert_termlist.cc.
References LOGCALL, RETURN, and termlist_size.
Referenced by ChertDatabase::get_unique_terms(), and ChertWritableDatabase::get_unique_terms().
chert_doclen_t ChertTermList::get_doclength | ( | ) | const |
Return the length of this document.
This is a non-virtual method, used by ChertDatabase.
Definition at line 81 of file chert_termlist.cc.
References doclen, LOGCALL, and RETURN.
Referenced by ChertWritableDatabase::delete_document(), and ChertWritableDatabase::replace_document().
|
virtual |
Return the term frequency for the term at the current position.
In order to be able to support updating databases efficiently, we can't store this value in the termlist table, so it has to be read from the postlist table, which is relatively expensive (compared to reading the wdf for example).
Implements Xapian::TermIterator::Internal.
Definition at line 118 of file chert_termlist.cc.
References current_term, current_termfreq, db, ChertDatabase::get_freqs(), LOGCALL, and RETURN.
Referenced by accumulate_stats().
|
virtual |
Return the termname at the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 104 of file chert_termlist.cc.
References current_term, LOGCALL, and RETURN.
Referenced by ChertWritableDatabase::delete_document(), and ChertWritableDatabase::replace_document().
|
virtual |
Return the wdf for the term at the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 111 of file chert_termlist.cc.
References current_wdf, LOGCALL, and RETURN.
Referenced by ChertWritableDatabase::delete_document(), and ChertWritableDatabase::replace_document().
|
virtual |
Advance the current position to the next term in the termlist.
The list starts before the first term in the list, so next() must be called before any methods which need the context of the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 127 of file chert_termlist.cc.
References Assert, at_end(), current_term, current_termfreq, current_wdf, end, LOGCALL, pos, RETURN, and unpack_uint().
Referenced by ChertWritableDatabase::delete_document(), ChertWritableDatabase::replace_document(), and skip_to().
|
private |
Don't allow assignment.
|
virtual |
Return a PositionIterator for the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 197 of file chert_termlist.cc.
References current_term, db, did, LOGCALL, ChertDatabase::position_table, and RETURN.
|
virtual |
Return the length of the position list for the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 190 of file chert_termlist.cc.
References current_term, db, did, LOGCALL, ChertDatabase::position_table, ChertPositionListTable::positionlist_count(), and RETURN.
|
virtual |
Skip forward to the specified term.
If the specified term isn't in the list, position ourselves on the first term after tname (or at_end() if no terms after tname exist).
Implements Xapian::TermIterator::Internal.
Definition at line 173 of file chert_termlist.cc.
References current_term, LOGCALL, next(), pos, and RETURN.
|
private |
The termname at the current position.
Definition at line 73 of file chert_termlist.h.
Referenced by get_termfreq(), get_termname(), next(), positionlist_begin(), positionlist_count(), and skip_to().
|
mutableprivate |
The term frequency for the term at the current position.
This will have the value 0 if the term frequency has not yet been looked up in the database (so it needs to be mutable).
Definition at line 83 of file chert_termlist.h.
Referenced by get_termfreq(), and next().
|
private |
The wdf for the term at the current position.
Definition at line 76 of file chert_termlist.h.
Referenced by accumulate_stats(), get_wdf(), and next().
|
private |
The tag value from the termlist table which holds the encoded termlist.
Definition at line 61 of file chert_termlist.h.
Referenced by ChertTermList().
|
private |
The database we're reading data from.
Definition at line 49 of file chert_termlist.h.
Referenced by accumulate_stats(), ChertTermList(), get_termfreq(), positionlist_begin(), and positionlist_count().
|
private |
The document id that this TermList is for.
Definition at line 52 of file chert_termlist.h.
Referenced by ChertTermList(), positionlist_begin(), and positionlist_count().
|
private |
The length of document did.
Definition at line 55 of file chert_termlist.h.
Referenced by accumulate_stats(), ChertTermList(), and get_doclength().
|
private |
Pointer to the end of the encoded tag value.
Definition at line 70 of file chert_termlist.h.
Referenced by ChertTermList(), and next().
|
private |
Current position with the encoded tag value held in data.
If we've iterated to the end of the list, this gets set to NULL.
Definition at line 67 of file chert_termlist.h.
Referenced by at_end(), ChertTermList(), next(), and skip_to().
|
private |
The number of entries in this termlist.
Definition at line 58 of file chert_termlist.h.
Referenced by ChertTermList(), and get_approx_size().