xapian-core  1.4.27
multi_termlist.cc
Go to the documentation of this file.
1 
23 #include <config.h>
24 
25 #include "multi_termlist.h"
26 
27 #include "backends/database.h"
28 #include "debuglog.h"
29 #include "expand/expandweight.h"
30 
32  const Xapian::Database &db_,
33  size_t db_index_)
34  : tl(tl_), db(db_), db_index(db_index_)
35 {
36 }
37 
39 {
40  delete tl;
41 }
42 
45 {
46  return tl->get_approx_size();
47 }
48 
49 void
51 {
52  tl->accumulate_stats(stats);
53 }
54 
55 string
57 {
58  return tl->get_termname();
59 }
60 
62 {
63  return tl->get_wdf();
64 }
65 
67 {
68  return db.get_termfreq(tl->get_termname());
69 }
70 
72 {
73  return tl->next();
74 }
75 
76 TermList * MultiTermList::skip_to(const string & term)
77 {
78  return tl->skip_to(term);
79 }
80 
82 {
83  return tl->at_end();
84 }
85 
88 {
89  return tl->positionlist_count();
90 }
91 
94 {
95  return tl->positionlist_begin();
96 }
TermList * tl
virtual Xapian::termcount get_wdf() const =0
Return the wdf for the term at the current position.
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
virtual Internal * next()=0
Advance the current position to the next term in the termlist.
const Xapian::Database & db
This class is used to access a database, or a group of databases.
Definition: database.h:68
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
bool at_end() const
Return true if the current position is past the last term in this list.
virtual Internal * skip_to(const std::string &term)=0
Skip forward to the specified term.
virtual void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
Definition: termlist.cc:34
Abstract base class for termlists.
Definition: termlist.h:39
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
MultiTermList(TermList *tl_, const Xapian::Database &db_, size_t db_index_)
virtual Xapian::termcount get_approx_size() const =0
Return approximate size of this termlist.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
TermList * next()
Advance the current position to the next term in the termlist.
Collate statistics and calculate the term weights for the ESet.
virtual bool at_end() const =0
Return true if the current position is past the last term in this list.
virtual Xapian::PositionIterator positionlist_begin() const =0
Return a PositionIterator for the current position.
string get_termname() const
Return the termname at the current position.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Class for iterating over term positions.
virtual std::string get_termname() const =0
Return the termname at the current position.
C++ class declaration for multiple database access.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
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.
virtual Xapian::termcount positionlist_count() const =0
Return the length of the position list for the current position.
Xapian::doccount get_termfreq(const std::string &tname) const
Get the number of documents in the database indexed by a given term.
Definition: omdatabase.cc:323
Debug logging macros.