22 #ifndef XAPIAN_INCLUDED_LOCALSUBMATCH_H
23 #define XAPIAN_INCLUDED_LOCALSUBMATCH_H
88 return estimate_op->
resolve(db_size, db_first, db_last);
130 bool compound_weight,
144 #ifdef XAPIAN_ASSERTIONS
148 AssertEq(res.first->second.termfreq, tf);
149 AssertEq(res.first->second.collfreq, cf);
152 if (termfreqs) *termfreqs = res.first->second;
Class for estimating the total number of matching documents.
Estimates resolve(Xapian::doccount db_size, Xapian::docid db_first, Xapian::docid db_last)
Abstract base class for leaf postlists.
Xapian::termcount get_collfreq() const
Get the collection frequency of the term.
const std::string & get_term() const
Get the term name.
bool weight_needs_wdf() const
const Xapian::Database::Internal * db
The (sub-)Database we're searching.
const Xapian::Weight::Internal * get_stats() const
Xapian::doccount shard_index
0-based index for the subdatabase.
LocalSubMatch & operator=(const LocalSubMatch &)=delete
Don't allow assignment.
PostListAndEstimate open_post_list(const std::string &term, Xapian::termcount wqf, double factor, bool need_positions, bool compound_weight, Xapian::Internal::QueryOptimiser *qopt, bool lazy_weight, TermFreqs *termfreqs)
LocalSubMatch(const Xapian::Database::Internal *db_, const Xapian::Query &query_, Xapian::termcount qlen_, const Xapian::Weight &wt_factory_, Xapian::doccount shard_index_)
Constructor.
LocalSubMatch(const LocalSubMatch &)=delete
Don't allow copying.
Xapian::Query query
The query.
void prepare_match(const Xapian::RSet &rset, Xapian::Weight::Internal &stats)
Fetch and collate statistics.
void start_match(Xapian::Weight::Internal &total_stats_)
Set the collated statistics.
void register_lazy_postlist_for_stats(LeafPostList *pl, TermFreqs *termfreqs)
PostListAndEstimate get_postlist(PostListTree *matcher, Xapian::termcount *total_subqs_ptr)
Get PostList.
Xapian::Weight::Internal * total_stats
The statistics for the collection.
Xapian::termcount qlen
The query length (used by some weighting schemes).
PostListAndEstimate make_synonym_postlist(PostListTree *pltree, PostListAndEstimate or_pl, double factor, const TermFreqs &termfreqs)
Convert a postlist into a synonym postlist.
const Xapian::Weight & wt_factory
Weight object (used as a factory by calling create on it).
Estimates resolve(EstimateOp *estimate_op)
Virtual base class for Database internals.
virtual void get_used_docid_range(docid &first, docid &last) const
Find lowest and highest docids actually in use.
virtual void get_freqs(std::string_view term, doccount *termfreq_ptr, termcount *collfreq_ptr) const =0
Returns frequencies for a term.
virtual doccount get_doccount() const =0
Abstract base class for postlists.
Xapian::doccount get_termfreq() const
Get an estimate of the number of documents this PostList will return.
Class representing a query.
Class representing a set of documents judged as relevant.
Class to hold statistics for a given collection.
void accumulate_stats(const Xapian::Database::Internal &sub_db, const Xapian::RSet &rset)
Accumulate the rtermfreqs for terms in the query.
std::map< std::string, TermFreqs, std::less<> > termfreqs
Map of term frequencies and relevant term frequencies for the collection.
Abstract base class for weighting schemes.
bool get_sumpart_needs_wdf_() const
Virtual base class for Database internals.
Calculated bounds on and estimate of number of matches.
Abstract base class for leaf postlists.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
The frequencies for a term.
Xapian::Weight::Internal class, holding database and term statistics.