xapian-core  2.0.0
postlist.cc
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2009,2011,2015,2017 Olly Betts
5  *
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.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #include <config.h>
22 
23 #include "postlist.h"
24 
25 #include <xapian/error.h>
26 
27 #include "omassert.h"
28 
29 using namespace std;
30 
31 PostList::~PostList() {}
32 
34 PostList::get_wdf() const
35 {
36  throw Xapian::InvalidOperationError("get_wdf() not meaningful for this PostingIterator");
37 }
38 
40 PostList::read_position_list()
41 {
42  throw Xapian::UnimplementedError("OP_NEAR and OP_PHRASE only currently support leaf subqueries");
43 }
44 
46 PostList::open_position_list() const
47 {
48  throw Xapian::InvalidOperationError("open_position_list() not meaningful for this PostingIterator");
49 }
50 
51 PostList *
52 PostList::check(Xapian::docid did, double w_min, bool &valid)
53 {
54  valid = true;
55  return skip_to(did, w_min);
56 }
57 
59 PostList::count_matching_subqs() const
60 {
61  Assert(false);
62  return 0;
63 }
64 
65 void
66 PostList::gather_position_lists(OrPositionList*)
67 {
68  Assert(false);
69 }
70 
71 void
72 PostList::get_docid_range(Xapian::docid&, Xapian::docid&) const
73 {
74  // Default is to match the full range.
75 }
Abstract base class for postlists.
Definition: postlist.h:40
InvalidOperationError indicates the API was used in an invalid way.
Definition: error.h:271
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:32
UnimplementedError indicates an attempt to use an unimplemented feature.
Definition: error.h:313
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:64
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:51
Various assertion macros.
#define Assert(COND)
Definition: omassert.h:122
Abstract base class for postlists.