xapian-core  2.0.0
honey_alltermslist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2005,2007,2008,2009,2010,2011,2017,2024 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (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_HONEY_ALLTERMSLIST_H
22 #define XAPIAN_INCLUDED_HONEY_ALLTERMSLIST_H
23 
24 #include "backends/alltermslist.h"
25 #include "honey_database.h"
26 #include "honey_postlist.h"
27 
28 #include <string_view>
29 
30 class HoneyCursor;
31 
35 
38 
45 
58 
60  std::string prefix;
61 
68 
70  void read_termfreq() const;
71 
72  public:
73  HoneyAllTermsList(const HoneyDatabase* database_,
74  std::string_view prefix_)
75  : database(database_), prefix(prefix_) {}
76 
79 
81 
88 
90  TermList* next();
91 
93  TermList* skip_to(std::string_view term);
94 };
95 
96 #endif /* XAPIAN_INCLUDED_HONEY_ALLTERMSLIST_H */
Abstract base class for iterating all terms in a database.
Abstract base class for iterating all terms in a database.
Definition: alltermslist.h:27
HoneyCursor * cursor
A cursor which runs through the postlist table reading termnames from the keys.
Xapian::doccount get_termfreq() const
Returns the term frequency of the current term.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
TermList * next()
Advance to the next term in the list.
void read_termfreq() const
Read and cache the term frequency.
Xapian::Internal::intrusive_ptr< const HoneyDatabase > database
Reference to our database.
HoneyAllTermsList & operator=(const HoneyAllTermsList &)=delete
Assignment is not allowed.
std::string prefix
The prefix to restrict the terms to.
HoneyAllTermsList(const HoneyDatabase *database_, std::string_view prefix_)
TermList * skip_to(std::string_view term)
Advance to the first term which is >= term.
Xapian::doccount termfreq
The term frequency of the term at the current position.
~HoneyAllTermsList()
Destructor.
HoneyAllTermsList(const HoneyAllTermsList &)=delete
Copying is not allowed.
Database using honey backend.
Abstract base class for termlists.
Definition: termlist.h:42
string term
Database using honey backend.
PostList in a honey database.
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