2 * @brief PostList class implementing Query::OP_OR
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 #ifndef XAPIAN_INCLUDED_ORPOSTLIST_H
22 #define XAPIAN_INCLUDED_ORPOSTLIST_H
24 #include "backends/postlist.h"
28 /// PostList class implementing Query::OP_OR
29 class OrPostList
: public PostList
{
30 /// Don't allow assignment.
31 void operator=(const OrPostList
&) = delete;
33 /// Don't allow copying.
34 OrPostList(const OrPostList
&) = delete;
38 * We optimise assuming this side is more frequent, and so creators should
39 * try to set this side to the side with the higher estimated term
47 Xapian::docid l_did
= 0;
49 Xapian::docid r_did
= 0;
57 PostList
* decay_to_and(Xapian::docid did
,
59 bool* valid_ptr
= NULL
);
61 PostList
* decay_to_andmaybe(PostList
* left
,
65 bool* valid_ptr
= NULL
);
68 OrPostList(PostList
* left
, PostList
* right
, PostListTree
* pltree_
);
75 Xapian::docid
get_docid() const;
77 double get_weight(Xapian::termcount doclen
,
78 Xapian::termcount unique_terms
,
79 Xapian::termcount wdfdocmax
) const;
83 double recalc_maxweight();
85 PostList
* next(double w_min
);
87 PostList
* skip_to(Xapian::docid did
, double w_min
);
89 PostList
* check(Xapian::docid did
, double w_min
, bool& valid
);
91 void get_docid_range(Xapian::docid
& first
, Xapian::docid
& last
) const;
93 std::string
get_description() const;
95 Xapian::termcount
get_wdf() const;
97 Xapian::termcount
count_matching_subqs() const;
99 void gather_position_lists(OrPositionList
* orposlist
);
102 #endif // XAPIAN_INCLUDED_ORPOSTLIST_H