xapian-core  1.4.20
multi_termlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2002,2003,2004,2005,2006,2007,2010,2011 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef OM_HGUARD_MULTI_TERMLIST_H
24 #define OM_HGUARD_MULTI_TERMLIST_H
25 
26 #include "api/termlist.h"
27 #include "backends/database.h"
28 
29 class MultiTermList : public TermList {
30  friend class Xapian::Database;
31  private:
34  size_t db_index;
35 
36  MultiTermList(TermList * tl_,
37  const Xapian::Database &db_,
38  size_t db_index_);
39  public:
41 
44 
45  string get_termname() const;
46  Xapian::termcount get_wdf() const; // Number of occurrences of term in current doc
47  Xapian::doccount get_termfreq() const; // Number of docs indexed by term
48  TermList * next();
49  TermList * skip_to(const std::string & term);
50  bool at_end() const;
51 
53 
55 
57 };
58 
59 #endif /* OM_HGUARD_MULTI_TERMLIST_H */
TermList * tl
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
const Xapian::Database & db
This class is used to access a database, or a group of databases.
Definition: database.h:68
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
bool at_end() const
Return true if the current position is past the last term in this list.
Abstract base class for termlists.
Definition: termlist.h:39
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
MultiTermList(TermList *tl_, const Xapian::Database &db_, size_t db_index_)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
TermList * next()
Advance the current position to the next term in the termlist.
string get_termname() const
Return the termname at the current position.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Class for iterating over term positions.
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.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.