52 Internal::ExpandTerm::get_description()
const
54 string desc(
"ExpandTerm(");
70 const set<Xapian::docid> & docids = rset.
internal->docs;
72 vector<TermList*> termlists;
73 termlists.reserve(docids.size());
77 termlists.push_back(db.
internal->open_term_list_direct(did));
79 Assert(!termlists.empty());
82 for_each(termlists.begin(), termlists.end(),
96 LOGCALL_VOID(EXPAND,
"ESet::Internal::expand", max_esize | db | rset | edecider | eweight);
108 bool is_heap =
false;
112 if (new_root == tree.get()) {
117 LOGLINE(EXPAND,
"Replacing the root of the termlist tree");
118 tree.reset(new_root);
121 string term = tree->get_termname();
124 if (edecider && !(*edecider)(
term))
continue;
136 if (wt <= min_wt)
continue;
138 if (items.size() < max_esize) {
139 items.emplace_back(wt,
term);
145 Assert(items.size() == max_esize);
146 if (
rare(!is_heap)) {
148 std::less<Xapian::Internal::ExpandTerm>());
149 min_wt = items.front().wt;
151 if (wt <= min_wt)
continue;
156 std::less<Xapian::Internal::ExpandTerm>());
157 min_wt = items.front().wt;
163 std::less<Xapian::Internal::ExpandTerm>());
165 sort(items.begin(), items.end());
170 ESet::Internal::get_description()
const
172 string desc(
"ESet::Internal(ebound=");
175 for (
auto&& i : items) {
177 desc += i.get_description();
207 return internal->ebound;
213 string desc =
"ESet(";
238 string desc =
"ESetIterator(";
An indexed database of documents.
Xapian::Internal::intrusive_ptr_nonnull< Internal > internal
Xapian::ESet::size_type off_from_end
std::string get_description() const
Return a string describing this object.
std::string operator*() const
Get the term at the current position.
double get_weight() const
Get the weight for the current position.
Class which actually implements Xapian::ESet.
std::vector< Xapian::Internal::ExpandTerm > items
The ExpandTerm objects which represent the items in the ESet.
Class representing a list of search results.
std::string get_description() const
Return a string describing this object.
Xapian::termcount size() const
Return number of items in this ESet object.
Xapian::termcount get_ebound() const
Return a bound on the full size of this ESet object.
ESet & operator=(const ESet &o)
Copying is allowed.
Xapian::Internal::intrusive_ptr_nonnull< Internal > internal
ESet()
Default constructor.
Virtual base class for expand decider functor.
Class combining a term and its expand weight.
Class for calculating ESet term weights.
void collect_stats(TermList *merger, const std::string &term)
Get the term statistics.
virtual double get_weight() const =0
Calculate the weight.
Class representing a set of documents judged as relevant.
Xapian::Internal::intrusive_ptr< Internal > internal
bool empty() const
Return true if this RSet object is empty.
Abstract base class for termlists.
virtual Internal * next()=0
Advance the current position to the next term in the termlist.
Virtual base class for Database internals.
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
Append a string to an object description, escaping invalid UTF-8.
Xapian::ESet::Internal class.
Allow rejection of terms during ESet generation.
Collate statistics and calculate the term weights for the ESet.
C++ STL heap implementation with extensions.
Multi-database support functions.
void replace(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void make(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void sort(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
static TermList * build_termlist_tree(const Xapian::Database &db, const RSet &rset)
Build a tree of binary TermList objects like QueryOptimiser does for OrPostList objects.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Various assertion macros.
#define AssertRel(A, REL, B)
Merge two TermList objects using an OR operation.
Set of documents judged as relevant.
Convert types to std::string.
Abstract base class for termlists.
Build tree to merge TermList objects.
TermList * make_termlist_merger(std::vector< TermList * > &termlists)
void description_append(std::string &desc, std::string_view s)