xapian-core  1.4.19
orpospostlist.h
Go to the documentation of this file.
1 
4 /* Copyright 2017 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_ORPOSPOSTLIST_H
22 #define XAPIAN_INCLUDED_ORPOSPOSTLIST_H
23 
24 #include "api/postlist.h"
25 #include "orpositionlist.h"
26 
28 class OrPosPostList : public PostList {
30  void operator=(const OrPosPostList &);
31 
34 
36 
38 
39  public:
41  : pl(pl_) { }
42 
44 
46 
48 
50 
52  const Xapian::Weight::Internal & stats) const;
53 
54  double get_maxweight() const;
55 
56  Xapian::docid get_docid() const;
57 
59 
61 
62  double get_weight() const;
63 
64  bool at_end() const;
65 
66  double recalc_maxweight();
67 
69 
70  Internal *next(double w_min);
71 
72  Internal *skip_to(Xapian::docid, double w_min);
73 
74  std::string get_description() const;
75 
76  Xapian::termcount get_wdf() const;
77 
79 };
80 
81 #endif // XAPIAN_INCLUDED_ORPOSPOSTLIST_H
Wrapper postlist providing positions for an OR.
Definition: orpospostlist.h:28
Abstract base class for postlists.
Definition: postlist.h:37
PostList * pl
Definition: orpospostlist.h:35
OrPosPostList(const OrPosPostList &)
Don't allow copying.
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
Xapian::docid get_docid() const
Return the current docid.
void operator=(const OrPosPostList &)
Don't allow assignment.
Abstract base class for postlists.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
Xapian::termcount get_doclength() const
Return the length of current document.
bool at_end() const
Return true if the current position is past the last entry in this list.
Internal * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
double get_weight() const
Return the weight contribution for the current position.
Class to hold statistics for a given collection.
Internal * next()
Advance the current position to the next document in the postlist.
Definition: postlist.h:194
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
std::string get_description() const
Return a string description of this object.
PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
Internal()
Only constructable as a base class for derived classes.
Definition: postlist.h:46
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
OrPosPostList(PostList *pl_)
Definition: orpospostlist.h:40
The frequencies for a term.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
OrPositionList position_list
Definition: orpospostlist.h:37
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:31
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
Merge two PositionList objects using an OR operation.