xapian-core  1.4.30
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 
104 
110 
116 
119 
121  std::string get_termname() const;
122 
124  Xapian::termcount get_wdf() const;
125 
134 
143  TermList * next();
144 
145  TermList * skip_to(const std::string & term);
146 
148  bool at_end() const;
149 
152 
155 };
156 
157 #endif // XAPIAN_INCLUDED_GLASS_TERMLIST_H
A TermList in a glass database.
Xapian::termcount get_doclength() const
Return the length of this document.
Xapian::termcount get_unique_terms() const
Return the number of unique terms.
Xapian::termcount termlist_size
The number of entries in this termlist.
std::string data
The tag value from the termlist table which holds the encoded termlist.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * next()
Advance the current position to the next term in the termlist.
std::string current_term
The termname at the current position.
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
Xapian::termcount current_wdf
The wdf for the term at the current position.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::docid did
The document id that this TermList is for.
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
const char * end
Pointer to the end of the encoded tag value.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
Xapian::doccount current_termfreq
The term frequency for the term at the current position.
Xapian::Internal::intrusive_ptr< const GlassDatabase > db
The database we're reading data from.
const char * pos
Current position with the encoded tag value held in data.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
GlassTermList(const GlassTermList &)
Don't allow copying.
void operator=(const GlassTermList &)
Don't allow assignment.
bool at_end() const
Return true if the current position is past the last term in this list.
Xapian::termcount doclen
The length of document did.
std::string get_termname() const
Return the termname at the current position.
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
Class for iterating over term positions.
Abstract base class for termlists.
Definition: termlist.h:39
C++ class definition for glass database.
Btree implementation.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
Class for iterating over term positions.
Abstract base class for termlists.
typedefs for Xapian