xapian-core
1.4.26
|
A term list for a database on the other side of a network connection. More...
#include <net_termlist.h>
Public Member Functions | |
Xapian::termcount | get_approx_size () const |
Get the number of terms in the termlist. More... | |
void | accumulate_stats (Xapian::Internal::ExpandStats &stats) const |
Collate weighting information for the current term. More... | |
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 | |
NetworkTermList (Xapian::termcount document_length_, Xapian::doccount database_size_, Xapian::Internal::intrusive_ptr< const RemoteDatabase > this_db_, Xapian::docid did_) | |
Standard constructor is private: NetworkTermLists are created by RemoteDatabase object only, which is a friend. More... | |
Private Attributes | |
vector< NetworkTermListItem > | items |
The list of items comprising the termlist. More... | |
vector< NetworkTermListItem >::const_iterator | current_position |
The current position in the list. More... | |
bool | started |
Whether we have yet started iterating through the list. More... | |
Xapian::termcount | document_length |
The length of the document for which this is the termlist. More... | |
Xapian::doccount | database_size |
The number of documents in the database in which this document resides. More... | |
Xapian::Internal::intrusive_ptr< const RemoteDatabase > | this_db |
Keep a reference to our database. More... | |
Xapian::docid | did |
The id of the document this termlist came from (or 0 if not applicable). More... | |
Friends | |
class | RemoteDatabase |
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 term list for a database on the other side of a network connection.
The termlist is serialised across the network, and rebuilt into this object on the client side.
Definition at line 62 of file net_termlist.h.
|
private |
Standard constructor is private: NetworkTermLists are created by RemoteDatabase object only, which is a friend.
document_length_ | The (non-normalised) length of the document |
database_size_ | The number of documents in the database |
this_db_ | The database |
did_ | The document id |
Definition at line 32 of file net_termlist.cc.
|
virtual |
Collate weighting information for the current term.
Reimplemented from Xapian::TermIterator::Internal.
Definition at line 53 of file net_termlist.cc.
References Xapian::Internal::ExpandStats::accumulate(), Assert, at_end(), current_position, database_size, document_length, Xapian::TermIterator::Internal::shard_index, and started.
|
virtual |
Return true if the current position is past the last term in this list.
Implements Xapian::TermIterator::Internal.
Definition at line 112 of file net_termlist.cc.
References Assert, current_position, items, and started.
Referenced by accumulate_stats(), get_termfreq(), get_termname(), get_wdf(), and next().
|
virtual |
Get the number of terms in the termlist.
Implements Xapian::TermIterator::Internal.
Definition at line 47 of file net_termlist.cc.
References items.
|
virtual |
Return the term frequency for the term at the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 82 of file net_termlist.cc.
References Assert, at_end(), current_position, and started.
|
virtual |
Return the termname at the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 66 of file net_termlist.cc.
References Assert, at_end(), current_position, and started.
Referenced by positionlist_begin().
|
virtual |
Return the wdf for the term at the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 74 of file net_termlist.cc.
References Assert, at_end(), current_position, and started.
|
virtual |
Advance the current position to the next term in the termlist.
The list starts before the first term in the list, so next(), skip_to() or check() must be called before any methods which need the context of the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 90 of file net_termlist.cc.
References Assert, at_end(), current_position, and started.
|
virtual |
Return a PositionIterator for the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 125 of file net_termlist.cc.
References did, get_termname(), RemoteDatabase::open_position_list(), and this_db.
|
virtual |
Return the length of the position list for the current position.
Implements Xapian::TermIterator::Internal.
Definition at line 119 of file net_termlist.cc.
|
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 102 of file net_termlist.cc.
References current_position, items, and started.
|
friend |
Definition at line 63 of file net_termlist.h.
|
private |
The current position in the list.
Definition at line 71 of file net_termlist.h.
Referenced by accumulate_stats(), at_end(), get_termfreq(), get_termname(), get_wdf(), next(), and skip_to().
|
private |
The number of documents in the database in which this document resides.
Note that this may not be the number of documents in the combined database when multiple databases are being searched.
Definition at line 89 of file net_termlist.h.
Referenced by accumulate_stats().
|
private |
The id of the document this termlist came from (or 0 if not applicable).
Definition at line 95 of file net_termlist.h.
Referenced by positionlist_begin().
|
private |
The length of the document for which this is the termlist.
Note that this is not a normalised document length.
Definition at line 81 of file net_termlist.h.
Referenced by accumulate_stats().
|
private |
The list of items comprising the termlist.
Definition at line 67 of file net_termlist.h.
Referenced by at_end(), get_approx_size(), and skip_to().
|
private |
Whether we have yet started iterating through the list.
Definition at line 75 of file net_termlist.h.
Referenced by accumulate_stats(), at_end(), get_termfreq(), get_termname(), get_wdf(), next(), and skip_to().
|
private |
Keep a reference to our database.
Definition at line 92 of file net_termlist.h.
Referenced by positionlist_begin().