xapian-core  1.4.27
orpostlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2002 Ananova Ltd
6  * Copyright 2003,2004,2009,2010,2011,2017 Olly Betts
7  * Copyright 2009 Lemur Consulting Ltd
8  * Copyright 2010 Richard Boulton
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License as
12  * published by the Free Software Foundation; either version 2 of the
13  * License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23  * USA
24  */
25 
26 #ifndef OM_HGUARD_ORPOSTLIST_H
27 #define OM_HGUARD_ORPOSTLIST_H
28 
29 #include "branchpostlist.h"
30 
38 class OrPostList : public BranchPostList {
39  private:
41  bool lvalid, rvalid;
42  double lmax, rmax, minmax;
44  public:
49  const Xapian::Weight::Internal & stats) const;
50 
51  Xapian::docid get_docid() const;
52  double get_weight() const;
53  double get_maxweight() const;
54 
55  double recalc_maxweight();
56 
57  PostList *next(double w_min);
58  PostList *skip_to(Xapian::docid did, double w_min);
59  PostList *check(Xapian::docid did, double w_min, bool &valid);
60  bool at_end() const;
61 
62  std::string get_description() const;
63 
71  virtual Xapian::termcount get_doclength() const;
72 
74  virtual Xapian::termcount get_unique_terms() const;
75 
76  OrPostList(PostList * left_,
77  PostList * right_,
78  MultiMatch * matcher_,
79  Xapian::doccount dbsize_);
80 
85  Xapian::termcount get_wdf() const;
86 
88 
89  void gather_position_lists(OrPositionList* orposlist);
90 };
91 
92 #endif /* OM_HGUARD_ORPOSTLIST_H */
Xapian::docid get_docid() const
Return the current docid.
Definition: orpostlist.cc:345
Abstract base class for postlists.
Definition: postlist.h:37
double get_weight() const
Return the weight contribution for the current position.
Definition: orpostlist.cc:354
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
Definition: orpostlist.cc:291
Xapian::docid lhead
Definition: orpostlist.h:40
Xapian::termcount get_wdf() const
get_wdf() for OR postlists returns the sum of the wdfs of the sub postlists which are at the current ...
Definition: orpostlist.cc:440
A postlist comprising two postlists ORed together.
Definition: orpostlist.h:38
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Definition: orpostlist.cc:365
Base class for postlists which are generated by merging two sub-postlists.
double rmax
Definition: orpostlist.h:42
double minmax
Definition: orpostlist.h:42
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Definition: orpostlist.cc:449
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
Definition: orpostlist.cc:196
std::string get_description() const
Return a string description of this object.
Definition: orpostlist.cc:394
double lmax
Definition: orpostlist.h:42
virtual Xapian::termcount get_doclength() const
Return the document length of the document the current term comes from.
Definition: orpostlist.cc:400
virtual base class for branched types of postlist
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
bool rvalid
Definition: orpostlist.h:41
Xapian::docid rhead
Definition: orpostlist.h:40
virtual Xapian::termcount get_unique_terms() const
Return the number of unique terms in the document.
Definition: orpostlist.cc:420
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
Definition: orpostlist.cc:131
bool at_end() const
Return true if the current position is past the last entry in this list.
Definition: orpostlist.cc:385
Xapian::doccount dbsize
Definition: orpostlist.h:43
The frequencies for a term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
OrPostList(PostList *left_, PostList *right_, MultiMatch *matcher_, Xapian::doccount dbsize_)
Definition: orpostlist.cc:38
void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
Definition: orpostlist.cc:458
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
Definition: orpostlist.cc:284
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
Definition: orpostlist.cc:277
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
bool lvalid
Definition: orpostlist.h:41
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Definition: orpostlist.cc:372
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
Definition: orpostlist.cc:312