xapian-core  1.4.21
multi_postlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2003,2005,2007,2009,2011 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef OM_HGUARD_MULTI_POSTLIST_H
24 #define OM_HGUARD_MULTI_POSTLIST_H
25 
26 #include "api/leafpostlist.h"
27 #include <vector>
28 
29 class MultiPostList : public PostList {
30  friend class Xapian::Database;
31  private:
32  std::vector<LeafPostList *> postlists;
33 
35 
36  bool finished;
38 
40 
41  MultiPostList(std::vector<LeafPostList *> & pls,
42  const Xapian::Database &this_db_);
43  public:
45 
49 
50  double get_maxweight() const;
51  double get_weight() const;
52  double recalc_maxweight();
53 
54  Xapian::docid get_docid() const; // Gets current docid
55  Xapian::termcount get_doclength() const; // Get length of current document
56  Xapian::termcount get_unique_terms() const; // Get number of unique term in current document
57  Xapian::termcount get_wdf() const; // Within Document Frequency
59  PostList *next(double w_min); // Moves to next docid
60  PostList *skip_to(Xapian::docid did, double w_min);// Moves to next docid >= specified docid
61  bool at_end() const; // True if we're off the end of the list
62 
63  std::string get_description() const;
64 };
65 
66 #endif /* OM_HGUARD_MULTI_POSTLIST_H */
Xapian::docid currdoc
Xapian::doccount multiplier
Abstract base class for postlists.
Definition: postlist.h:37
Xapian::termcount get_doclength() const
Return the length of current document.
std::string get_description() const
Return a string description of this object.
This class is used to access a database, or a group of databases.
Definition: database.h:68
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
PositionList * open_position_list() const
Read the position list for the term in the current document and return a pointer to it (not owned by ...
MultiPostList(std::vector< LeafPostList *> &pls, const Xapian::Database &this_db_)
Xapian::Database this_db
double get_weight() const
Return the weight contribution for the current position.
std::vector< LeafPostList * > postlists
Abstract base class for leaf postlists.
Xapian::docid get_docid() const
Return the current docid.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
bool at_end() const
Return true if the current position is past the last entry in this list.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Internal * next()
Advance the current position to the next document in the postlist.
Definition: postlist.h:194
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
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.