43 Assert(!it->first.empty());
45 return it->second.docs.size();
54 if (!it->first.empty()) {
56 if (tname <= it->first)
return NULL;
61 }
else if (tname.empty()) {
63 while (it != tmap->end() && it->second.term_freq == 0) ++it;
64 if (it == tmap->end())
66 current_term = it->first;
70 it = tmap->lower_bound(tname);
71 while (it != tmap->end() && it->second.term_freq == 0) ++it;
72 if (it == tmap->end() || !
startswith(it->first, prefix)) {
75 current_term = it->first;
84 if (it->first.empty() && !prefix.empty()) {
85 it = tmap->lower_bound(prefix);
89 while (it != tmap->end() && it->second.term_freq == 0) ++it;
90 if (it == tmap->end() || !
startswith(it->first, prefix)) {
93 current_term = it->first;
97 #ifdef DISABLE_GPL_LIBXAPIAN
98 # error GPL source we cannot relicense included in libxapian
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * skip_to(std::string_view tname)
Skip forward to the specified term.
TermList * next()
next() causes the AllTermsList to move to the next term in the list.
static void throw_database_closed()
Abstract base class for termlists.
Iterate all terms in an inmemory db.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Various handy string-related helpers.
bool startswith(std::string_view s, char pfx)