1 /** @file multi_postlist.h
2 * @brief C++ class definition for multiple database access
4 /* Copyright 1999,2000,2001 BrightStation PLC
5 * Copyright 2003,2005,2007,2009,2011 Olly Betts
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.
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.
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
23 #ifndef OM_HGUARD_MULTI_POSTLIST_H
24 #define OM_HGUARD_MULTI_POSTLIST_H
26 #include "api/leafpostlist.h"
29 class MultiPostList
: public PostList
{
30 friend class Xapian::Database
;
32 std::vector
<LeafPostList
*> postlists
;
34 const Xapian::Database
&this_db
;
37 Xapian::docid currdoc
;
39 Xapian::doccount multiplier
;
41 MultiPostList(std::vector
<LeafPostList
*> & pls
,
42 const Xapian::Database
&this_db_
);
46 Xapian::doccount
get_termfreq_min() const;
47 Xapian::doccount
get_termfreq_max() const;
48 Xapian::doccount
get_termfreq_est() const;
50 double get_maxweight() const;
51 double get_weight() const;
52 double recalc_maxweight();
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
58 PositionList
* open_position_list() const;
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
63 std::string
get_description() const;
66 #endif /* OM_HGUARD_MULTI_POSTLIST_H */