xapian-core  1.4.25
mergepostlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2002 Ananova Ltd
6  * Copyright 2002,2003,2004,2005,2009,2011,2015,2016 Olly Betts
7  * Copyright 2007 Lemur Consulting Ltd
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22  * USA
23  */
24 
25 #ifndef OM_HGUARD_MERGEPOSTLIST_H
26 #define OM_HGUARD_MERGEPOSTLIST_H
27 
28 #include "api/postlist.h"
29 
30 class MultiMatch;
32 
35 class MergePostList : public PostList {
36  private:
37  // Prevent copying
40 
41  double w_max;
42 
43  vector<PostList *> plists;
44 
45  int current;
46 
53 
61 
62  public:
63  Xapian::termcount get_wdf() const;
67 
68  Xapian::docid get_docid() const;
69  double get_weight() const;
70  const string * get_sort_key() const;
71  const string * get_collapse_key() const;
72 
73  double get_maxweight() const;
74 
75  double recalc_maxweight();
76 
77  PostList *next(double w_min);
78  PostList *skip_to(Xapian::docid did, double w_min);
79  bool at_end() const;
80 
81  string get_description() const;
82 
86  virtual Xapian::termcount get_doclength() const;
87 
89  virtual Xapian::termcount get_unique_terms() const;
90 
92 
93  MergePostList(const std::vector<PostList *> & plists_,
94  MultiMatch *matcher_,
95  ValueStreamDocument & vsdoc_)
96  : plists(plists_), current(-1), matcher(matcher_), vsdoc(vsdoc_)
97  { }
98 
100 };
101 
102 #endif /* OM_HGUARD_MERGEPOSTLIST_H */
Abstract base class for postlists.
Definition: postlist.h:37
string get_description() const
Return a string description of this object.
A document which gets its values from a ValueStreamManager.
MergePostList(const std::vector< PostList *> &plists_, MultiMatch *matcher_, ValueStreamDocument &vsdoc_)
Definition: mergepostlist.h:93
MergePostList & operator=(const MergePostList &)
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
const string * get_sort_key() const
MergePostList(const MergePostList &)
double get_weight() const
Return the weight contribution for the current position.
A postlist comprising postlists from different databases merged together.
Definition: mergepostlist.h:35
Abstract base class for postlists.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
Internal * next()
Advance the current position to the next document in the postlist.
Definition: postlist.h:194
const string * get_collapse_key() const
If the collapse key is already known, return it.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
virtual Xapian::termcount get_unique_terms() const
Return the number of unique terms in the document.
Xapian::docid get_docid() const
Return the current docid.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
ValueStreamDocument & vsdoc
Document proxy used for valuestream caching.
Definition: mergepostlist.h:60
virtual Xapian::termcount get_doclength() const
Return the document length of the document the current term comes from.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
vector< PostList * > plists
Definition: mergepostlist.h:43
bool at_end() const
Return true if the current position is past the last entry in this list.
MultiMatch * matcher
The object which is using this postlist to perform a match.
Definition: mergepostlist.h:52