xapian-core  1.4.25
net_termlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2003,2006,2007,2009,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_NET_TERMLIST_H
24 #define OM_HGUARD_NET_TERMLIST_H
25 
26 #include <string>
27 
28 #include <xapian/types.h>
29 #include <xapian/error.h>
30 #include "api/termlist.h"
31 #include "expand/expandweight.h"
32 #include "remote-database.h"
33 
34 using namespace std;
35 
39  public:
42  string tname;
43 
49 
56 };
57 
62 class NetworkTermList : public TermList {
63  friend class RemoteDatabase;
64  private:
67  vector<NetworkTermListItem> items;
68 
71  vector<NetworkTermListItem>::const_iterator current_position;
72 
75  bool started;
76 
82 
90 
93 
96 
105  NetworkTermList(Xapian::termcount document_length_,
106  Xapian::doccount database_size_,
108  Xapian::docid did_);
109  public:
110 
113  Xapian::termcount get_approx_size() const;
114 
115  // Collate weighting information for the current term.
116  void accumulate_stats(Xapian::Internal::ExpandStats &stats) const;
117  string get_termname() const;
118  Xapian::termcount get_wdf() const;
119  Xapian::doccount get_termfreq() const;
120  TermList * next();
121  TermList * skip_to(const std::string &term);
122  bool at_end() const;
123 
124  Xapian::termcount positionlist_count() const;
125  Xapian::PositionIterator positionlist_begin() const;
126 };
127 
128 #endif /* OM_HGUARD_NET_TERMLIST_H */
An item in a NetworkTermList.
Definition: net_termlist.h:38
typedefs for Xapian
Xapian::termcount wdf
The within-document-frequency of the term.
Definition: net_termlist.h:55
vector< NetworkTermListItem >::const_iterator current_position
The current position in the list.
Definition: net_termlist.h:71
RemoteDatabase is the baseclass for remote database implementations.
Abstract base class for termlists.
Definition: termlist.h:39
STL namespace.
Xapian::Internal::intrusive_ptr< const RemoteDatabase > this_db
Keep a reference to our database.
Definition: net_termlist.h:92
Xapian::doccount termfreq
The term frequency.
Definition: net_termlist.h:48
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
bool started
Whether we have yet started iterating through the list.
Definition: net_termlist.h:75
Collate statistics and calculate the term weights for the ESet.
Xapian::termcount document_length
The length of the document for which this is the termlist.
Definition: net_termlist.h:81
Xapian::docid did
The id of the document this termlist came from (or 0 if not applicable).
Definition: net_termlist.h:95
RemoteDatabase is the baseclass for remote database implementations.
Class for iterating over term positions.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
A term list for a database on the other side of a network connection.
Definition: net_termlist.h:62
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
string tname
The "name" of this term.
Definition: net_termlist.h:42
Abstract base class for termlists.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
vector< NetworkTermListItem > items
The list of items comprising the termlist.
Definition: net_termlist.h:67
Xapian::doccount database_size
The number of documents in the database in which this document resides.
Definition: net_termlist.h:89