xapian-core  1.4.25
glass_termlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2009,2010,2011 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (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_GLASS_TERMLIST_H
22 #define XAPIAN_INCLUDED_GLASS_TERMLIST_H
23 
24 #include <string>
25 
26 #include "xapian/intrusive_ptr.h"
28 #include <xapian/types.h>
29 
30 namespace Xapian {
31  namespace Internal {
32  class ExpandStats;
33  }
34 }
35 
36 #include "glass_database.h"
37 #include "api/termlist.h"
38 #include "glass_table.h"
39 
41 class GlassTermList : public TermList {
43  void operator=(const GlassTermList &);
44 
47 
50 
53 
56 
59 
61  std::string data;
62 
67  const char *pos;
68 
70  const char *end;
71 
73  std::string current_term;
74 
77 
84 
85  public:
97  Xapian::docid did_, bool throw_if_not_present = true);
98 
103  Xapian::termcount get_doclength() const;
104 
109  Xapian::termcount get_unique_terms() const;
110 
115  Xapian::termcount get_approx_size() const;
116 
118  void accumulate_stats(Xapian::Internal::ExpandStats & stats) const;
119 
121  std::string get_termname() const;
122 
124  Xapian::termcount get_wdf() const;
125 
133  Xapian::doccount get_termfreq() const;
134 
143  TermList * next();
144 
145  TermList * skip_to(const std::string & term);
146 
148  bool at_end() const;
149 
151  Xapian::termcount positionlist_count() const;
152 
154  Xapian::PositionIterator positionlist_begin() const;
155 };
156 
157 #endif // XAPIAN_INCLUDED_GLASS_TERMLIST_H
Xapian::termcount termlist_size
The number of entries in this termlist.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
Xapian::docid did
The document id that this TermList is for.
typedefs for Xapian
const char * end
Pointer to the end of the encoded tag value.
Abstract base class for termlists.
Definition: termlist.h:39
Class for iterating over term positions.
Xapian::termcount current_wdf
The wdf for the term at the current position.
std::string current_term
The termname at the current position.
const char * pos
Current position with the encoded tag value held in data.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
A TermList in a glass database.
Xapian::Internal::intrusive_ptr< const GlassDatabase > db
The database we&#39;re reading data from.
Xapian::doccount current_termfreq
The term frequency for the term at the current position.
C++ class definition for glass database.
Class for iterating over term positions.
Btree implementation.
Xapian::termcount doclen
The length of document did.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
std::string data
The tag value from the termlist table which holds the encoded termlist.
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
Abstract base class for termlists.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52