xapian-core  1.4.26
ortermlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2010 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 #ifndef XAPIAN_INCLUDED_ORTERMLIST_H
22 #define XAPIAN_INCLUDED_ORTERMLIST_H
23 
24 #include "api/termlist.h"
25 
26 namespace Xapian {
27 namespace Internal {
28 class ExpandStats;
29 }
30 }
31 
32 class OrTermList : public TermList {
33  protected:
35  TermList *left, *right;
36 
43  std::string left_current, right_current;
44 
46  void check_started() const;
47 
48  public:
49  OrTermList(TermList * left_, TermList * right_)
50  : left(left_), right(right_) { }
51 
52  ~OrTermList();
53 
54  Xapian::termcount get_approx_size() const;
55 
56  void accumulate_stats(Xapian::Internal::ExpandStats & stats) const;
57 
58  std::string get_termname() const;
59 
60  Xapian::termcount get_wdf() const;
61 
62  Xapian::doccount get_termfreq() const;
63 
64  TermList *next();
65 
66  TermList * skip_to(const std::string & term);
67 
68  bool at_end() const;
69 
70  Xapian::termcount positionlist_count() const;
71 
72  Xapian::PositionIterator positionlist_begin() const;
73 };
74 
82  public:
84  : OrTermList(left_, right_)
85  { }
86 
87  Xapian::doccount get_termfreq() const;
88 };
89 
90 #endif // XAPIAN_INCLUDED_ORTERMLIST_H
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
FreqAdderOrTermList(TermList *left_, TermList *right_)
Definition: ortermlist.h:83
Abstract base class for termlists.
Definition: termlist.h:39
std::string right_current
Definition: ortermlist.h:43
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
Class for iterating over term positions.
A termlist which ORs two termlists together, adding term frequencies.
Definition: ortermlist.h:81
OrTermList(TermList *left_, TermList *right_)
Definition: ortermlist.h:49
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
Abstract base class for termlists.
TermList * right
Definition: ortermlist.h:35