omegatest: Use test_scriptindex_error in another case
[xapian.git] / xapian-core / matcher / orpospostlist.cc
blob7c1177b6c1ca5c4de081d42de590e6ef4e2f1660
1 /** @file
2 * @brief Wrapper postlist providing positions for an OR
3 */
4 /* Copyright 2017 Olly Betts
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.
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.
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
21 #include <config.h>
23 #include "orpospostlist.h"
25 OrPosPostList::~OrPosPostList()
27 delete pl;
30 Xapian::doccount
31 OrPosPostList::get_termfreq_min() const
33 return pl->get_termfreq_min();
36 Xapian::doccount
37 OrPosPostList::get_termfreq_max() const
39 return pl->get_termfreq_max();
42 Xapian::doccount
43 OrPosPostList::get_termfreq_est() const
45 return pl->get_termfreq_est();
48 TermFreqs
49 OrPosPostList::get_termfreq_est_using_stats(const Xapian::Weight::Internal & stats) const
51 return pl->get_termfreq_est_using_stats(stats);
54 double
55 OrPosPostList::get_maxweight() const
57 return pl->get_maxweight();
60 Xapian::docid
61 OrPosPostList::get_docid() const
63 return pl->get_docid();
66 Xapian::termcount
67 OrPosPostList::get_doclength() const
69 return pl->get_doclength();
72 Xapian::termcount
73 OrPosPostList::get_unique_terms() const
75 return pl->get_unique_terms();
78 double
79 OrPosPostList::get_weight() const
81 return pl->get_weight();
84 bool
85 OrPosPostList::at_end() const
87 return pl->at_end();
90 double
91 OrPosPostList::recalc_maxweight()
93 return pl->recalc_maxweight();
96 PositionList *
97 OrPosPostList::read_position_list()
99 return position_list.gather(pl);
102 PostList*
103 OrPosPostList::next(double w_min)
105 PostList* result = pl->next(w_min);
106 if (result) {
107 delete pl;
108 pl = result;
110 return NULL;
113 PostList*
114 OrPosPostList::skip_to(Xapian::docid did, double w_min)
116 PostList* result = pl->skip_to(did, w_min);
117 if (result) {
118 delete pl;
119 pl = result;
121 return NULL;
124 std::string
125 OrPosPostList::get_description() const
127 string desc = "OrPosPostList(";
128 desc += pl->get_description();
129 desc += ')';
130 return desc;
133 Xapian::termcount
134 OrPosPostList::get_wdf() const
136 return pl->get_wdf();
139 Xapian::termcount
140 OrPosPostList::count_matching_subqs() const
142 return pl->count_matching_subqs();