xapian-core  2.0.0
remote_termlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2011,2018,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_REMOTE_TERMLIST_H
22 #define XAPIAN_INCLUDED_REMOTE_TERMLIST_H
23 
24 #include "api/termlist.h"
25 
26 class RemoteDatabase;
27 
29 class RemoteTermList : public TermList {
31  void operator=(const RemoteTermList &) = delete;
32 
34  RemoteTermList(const RemoteTermList &) = delete;
35 
37 
39 
41 
43 
45 
47 
49 
50  std::string data;
51 
52  const char* p = NULL;
53 
54  public:
57  Xapian::termcount doclen_,
58  Xapian::doccount db_size_,
59  const RemoteDatabase* db_,
60  Xapian::docid did_,
61  std::string&& data_)
62  : num_entries(num_entries_),
63  doclen(doclen_),
64  db_size(db_size_),
65  db(db_),
66  did(did_),
67  data(data_) {}
68 
71 
73 
75  Xapian::termcount get_wdf() const;
76 
79 
81  TermList* next();
82 
88  TermList* skip_to(std::string_view term);
89 
92 
95 };
96 
97 #endif // XAPIAN_INCLUDED_REMOTE_TERMLIST_H
RemoteDatabase is the baseclass for remote database implementations.
Iterate terms in a remote document.
Xapian::termcount num_entries
RemoteTermList(const RemoteTermList &)=delete
Don't allow copying.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Xapian::doccount db_size
std::string data
Xapian::termcount doclen
Xapian::termcount current_wdf
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
void operator=(const RemoteTermList &)=delete
Don't allow assignment.
RemoteTermList(Xapian::termcount num_entries_, Xapian::termcount doclen_, Xapian::doccount db_size_, const RemoteDatabase *db_, Xapian::docid did_, std::string &&data_)
Construct.
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
Xapian::docid did
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 get_approx_size() const
Return approximate size of this termlist.
Xapian::Internal::intrusive_ptr< const RemoteDatabase > db
const char * p
PositionList * positionlist_begin() const
Return PositionList for the current position.
Xapian::doccount current_termfreq
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
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
Abstract base class for termlists.