36 for (
auto pl : pls) size += pl->get_approx_size();
46 result = max(result, pl->back());
66 LOGCALL(EXPAND,
bool,
"OrPositionList::next", NO_ARGS);
67 bool first = current.empty();
68 if (first) current.resize(pls.size());
72 for (
size_t i = 0; i != pls.size(); ++i) {
75 if (first || current[i] <= old_pos) {
82 current_pos = min(current_pos,
pos);
84 if (i != j) pls[j] = pls[i];
99 bool first = current.empty();
100 if (!first &&
termpos <= current_pos)
102 if (first) current.resize(pls.size());
105 for (
size_t i = 0; i != pls.size(); ++i) {
108 if (first ||
termpos > current[i]) {
115 current_pos = min(current_pos,
pos);
117 if (i != j) pls[j] = pls[i];
bool next()
Advance to the next entry in the positionlist.
Xapian::termcount get_approx_size() const
Return approximate size of this positionlist.
Xapian::termpos get_position() const
Return the current position.
Xapian::termpos back() const
Return the final entry in this positionlist.
bool skip_to(Xapian::termpos termpos)
Skip forward to the specified position.
Abstract base class for iterating term positions in a document.
virtual bool next()=0
Advance to the next entry in the positionlist.
virtual bool skip_to(Xapian::termpos termpos)=0
Skip forward to the specified position.
virtual Xapian::termpos get_position() const =0
Return the current position.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Merge two PositionList objects using an OR operation.