36 inplace_merge(positions.begin(),
37 positions.begin() + split,
45 if (
rare(is_deleted())) {
55 if (positions.empty()) {
59 if (
termpos > positions.back()) {
62 auto i = lower_bound(positions.cbegin(),
63 positions.cbegin() + split,
65 if (i != positions.cbegin() + split && *i ==
termpos)
72 if (
termpos == positions.back()) {
85 auto i = lower_bound(positions.cbegin(), positions.cend(),
termpos);
87 if (i == positions.cend() || *i !=
termpos) {
88 auto new_split = positions.size();
90 if (
rare(new_split > numeric_limits<decltype(split)>::max())) {
101 AssertRel(new_split, <=, numeric_limits<decltype(split)>::max());
114 if (
rare(positions.empty()))
118 if (positions.back() ==
termpos) {
119 positions.pop_back();
120 if (split == positions.size()) {
135 auto i = lower_bound(positions.cbegin(), positions.cend(),
termpos);
136 if (i == positions.cend() || *i !=
termpos) {
158 auto i = lower_bound(positions.cbegin(), positions.cend(), termpos_first);
159 if (i == positions.cend() || *i > termpos_last) {
162 auto j = upper_bound(i, positions.cend(), termpos_last);
163 size_t size_before = positions.size();
164 positions.erase(i, j);
bool add_position(Xapian::termcount wdf_inc, Xapian::termpos termpos)
Add a position.
bool remove_position(Xapian::termpos termpos)
Remove a position.
void merge() const
Merge sorted ranges before and after split.
Xapian::termpos remove_positions(Xapian::termpos termpos_first, Xapian::termpos termpos_last)
Remove a range of positions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Various assertion macros.
#define AssertRel(A, REL, B)
Metadata for a term in a document.