xapian-core  2.0.0
glass_termlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2009,2010,2011,2024 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, see
18  * <https://www.gnu.org/licenses/>.
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 
74 
81 
82  public:
94  Xapian::docid did_, bool throw_if_not_present = true);
95 
102  bool not_present() const { return pos == NULL; }
103 
109 
115 
121 
124 
126  Xapian::termcount get_wdf() const;
127 
136 
145  TermList * next();
146 
147  TermList* skip_to(std::string_view term);
148 
151 
154 };
155 
156 #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.
PositionList * positionlist_begin() const
Return a PositionIterator for the current position.
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.
TermList * skip_to(std::string_view term)
Skip forward to the specified term.
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.
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 not_present() const
Check if the term isn't present.
Xapian::termcount doclen
The length of document did.
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
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:32
Abstract base class for termlists.
Definition: termlist.h:42
string term
C++ class definition for glass database.
Btree implementation.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:64
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:37
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:51
Class for iterating over term positions.
Abstract base class for termlists.
typedefs for Xapian