xapian-core  1.4.26
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, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
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 namespace Xapian {
32 
33 PostingIterator::Internal::~Internal() { }
34 
36 PostingIterator::Internal::get_termfreq_est_using_stats(
37  const Xapian::Weight::Internal &) const
38 {
40  "get_termfreq_est_using_stats() not meaningful for this PostingIterator");
41 }
42 
44 PostingIterator::Internal::get_wdf() const
45 {
46  throw Xapian::InvalidOperationError("get_wdf() not meaningful for this PostingIterator");
47 }
48 
49 const string *
50 PostingIterator::Internal::get_sort_key() const
51 {
52  return NULL;
53 }
54 
55 const string *
56 PostingIterator::Internal::get_collapse_key() const
57 {
58  return NULL;
59 }
60 
63 {
64  throw Xapian::UnimplementedError("OP_NEAR and OP_PHRASE only currently support leaf subqueries");
65 }
66 
69 {
70  throw Xapian::InvalidOperationError("open_position_list() not meaningful for this PostingIterator");
71 }
72 
73 PostList *
74 PostList::check(Xapian::docid did, double w_min, bool &valid)
75 {
76  valid = true;
77  return skip_to(did, w_min);
78 }
79 
82 {
83  Assert(false);
84  return 0;
85 }
86 
87 void
89 {
90  Assert(false);
91 }
92 
93 }
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
#define Assert(COND)
Definition: omassert.h:122
Abstract base class for postlists.
Definition: postlist.h:37
virtual void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
InvalidOperationError indicates the API was used in an invalid way.
Definition: error.h:283
STL namespace.
Abstract base class for postlists.
virtual Internal * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
Class to hold statistics for a given collection.
virtual PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
virtual 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 ...
The frequencies for a term.
virtual Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Various assertion macros.
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
UnimplementedError indicates an attempt to use an unimplemented feature.
Definition: error.h:325