38 delete postlists[--n_shards];
52 return postlists[
shard_number(docids[0], n_shards)]->get_wdf();
69 return docids_size == 0;
84 return postlists[
shard_number(docids[0], n_shards)]->open_position_list();
90 if (docids_size == 0) {
107 std::greater<Xapian::docid>());
115 std::greater<Xapian::docid>());
117 postlists[shard] = NULL;
122 std::greater<Xapian::docid>());
133 if (docids_size == 0) {
141 pl->
skip_to(shard_did + (i < shard), w_min);
150 if (did <= docids[0])
155 if (did == docids[0] + 1)
163 PostList* pl = postlists[old_shard];
164 pl->
skip_to(shard_did + (old_shard < shard), w_min);
167 postlists[old_shard] = NULL;
172 docids[j++] = old_did;
177 Heap::make(docids, docids + docids_size, std::greater<Xapian::docid>());
185 string desc =
"MultiPostList(";
188 desc += postlists[i]->get_description();
bool at_end() const
Return true if the current position is past the last entry in this list.
std::string get_description() const
Return a string description of this object.
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
~MultiPostList()
Destructor.
PositionList * open_position_list() const
Read the position list for the term in the current document and.
Xapian::docid get_docid() const
Return the current docid.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
Abstract base class for postlists.
virtual PostList * skip_to(Xapian::docid did, double w_min)=0
Skip forward to the specified docid.
virtual PostList * next(double w_min)=0
Advance the current position to the next document in the postlist.
virtual Xapian::docid get_docid() const =0
Return the current docid.
virtual bool at_end() const =0
Return true if the current position is past the last entry in this list.
PostList * next()
Advance the current position to the next document in the postlist.
Abstract base class for iterating term positions in a document.
An indexed database of documents.
C++ STL heap implementation with extensions.
Multi-database support functions.
Xapian::doccount shard_number(Xapian::docid did, Xapian::doccount n_shards)
Convert docid in the multi-db to shard number.
Xapian::docid shard_docid(Xapian::docid did, Xapian::doccount n_shards)
Convert docid in the multi-db to the docid in the shard.
Xapian::docid unshard(Xapian::docid shard_did, Xapian::doccount shard, Xapian::doccount n_shards)
Convert shard number and shard docid to docid in multi-db.
Class for merging PostList objects from subdatabases.
void pop(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void replace(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void make(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
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.
Abstract base class for postlists.