xapian-core  2.0.0
externalpostlist.h
Go to the documentation of this file.
1 
4 /* Copyright 2008-2022 Olly Betts
5  * Copyright 2009 Lemur Consulting Ltd
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see
19  * <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef XAPIAN_INCLUDED_EXTERNALPOSTLIST_H
23 #define XAPIAN_INCLUDED_EXTERNALPOSTLIST_H
24 
25 #include "backends/postlist.h"
26 
27 namespace Xapian {
28  class PostingSource;
29 }
30 
31 class EstimateOp;
32 class PostListTree;
33 
34 class ExternalPostList : public PostList {
37 
39  void operator=(const ExternalPostList &);
40 
42 
44 
45  double factor;
46 
48 
49  public:
57  Xapian::PostingSource *source_,
58  EstimateOp* estimate_op,
59  double factor_,
60  bool* max_weight_cached_flag_ptr,
61  Xapian::doccount shard_index);
62 
63  Xapian::docid get_docid() const;
64 
65  double get_weight(Xapian::termcount doclen,
66  Xapian::termcount unique_terms,
67  Xapian::termcount wdfdocmax) const;
68 
69  double recalc_maxweight();
70 
72 
73  PostList * next(double w_min);
74 
75  PostList * skip_to(Xapian::docid, double w_min);
76 
77  PostList * check(Xapian::docid did, double w_min, bool &valid);
78 
79  bool at_end() const;
80 
82 
83  std::string get_description() const;
84 };
85 
86 #endif /* XAPIAN_INCLUDED_EXTERNALPOSTLIST_H */
Class for estimating the total number of matching documents.
Definition: estimateop.h:64
void operator=(const ExternalPostList &)
Disallow assignment.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
PostList * update_after_advance()
ExternalPostList(const ExternalPostList &)
Disallow copying.
PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
Xapian::docid current
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Xapian::Internal::opt_intrusive_ptr< Xapian::PostingSource > source
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
Xapian::docid get_docid() const
Return the current docid.
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.
An indexed database of documents.
Definition: database.h:75
Abstract base class for postlists.
Definition: postlist.h:40
PostList * next()
Advance the current position to the next document in the postlist.
Definition: postlist.h:168
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:32
Base class which provides an "external" source of postings.
Definition: postingsource.h:47
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:64
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:37
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:51
Abstract base class for postlists.