42 const string& lo = db->get_value_lower_bound(slot);
43 const string& hi = db->get_value_upper_bound(slot);
44 if (begin <= lo && (end.empty() || hi <= end)) {
48 return db->get_value_freq(slot);
61 for (
size_t i = prefix; i != s.size(); ++i) {
63 r +=
static_cast<unsigned char>(s[i]) * f;
74 const string& lo = db->get_value_lower_bound(slot);
75 const string& hi = db->get_value_upper_bound(slot);
78 size_t common_prefix_len = size_t(-1);
83 if (common_prefix_len == lo.size()) {
84 if (common_prefix_len != hi.size())
90 Assert(begin <= lo && (end.empty() || hi <= end));
91 return db->get_value_freq(slot);
93 AssertRel(common_prefix_len, !=, hi.size());
94 }
while (lo[common_prefix_len] == hi[common_prefix_len]);
99 if (
rare(denom == 0.0)) {
105 if (begin <= lo && (end.empty() || hi <= end)) {
109 return db->get_value_freq(slot);
115 return db->get_value_freq(slot) / 2;
123 if (!end.empty() && end < hi) {
128 double est = (e - b) / denom * db->get_value_freq(slot);
136 LOGCALL(MATCH,
TermFreqs,
"ValueRangePostList::get_termfreq_est_using_stats", stats);
147 return db->get_value_freq(slot);
161 return valuelist->get_docid();
203 if (!valuelist) valuelist = db->open_value_list(slot);
205 while (!valuelist->at_end()) {
206 const string & v = valuelist->get_value();
207 if (v >= begin && v <= end) {
220 if (!valuelist) valuelist = db->open_value_list(slot);
221 valuelist->skip_to(did);
222 while (!valuelist->at_end()) {
223 const string & v = valuelist->get_value();
224 if (v >= begin && v <= end) {
238 if (!valuelist) valuelist = db->open_value_list(slot);
239 valid = valuelist->check(did);
243 const string & v = valuelist->get_value();
244 valid = (v >= begin && v <= end);
263 string desc =
"ValueRangePostList(";
Abstract base class for postlists.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
#define AssertRel(A, REL, B)
std::string get_description() const
Return a string description of this object.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
Xapian::docid get_docid() const
Return the current docid.
Convert types to std::string.
static double est(double l, double r, double n)
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
Xapian::doccount collection_size
Number of documents in the collection.
#define AssertRelParanoid(A, REL, B)
Xapian::doccount rset_size
Number of relevant documents in the collection.
static double string_frac(const string &s, size_t prefix)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
void description_append(std::string &desc, const std::string &s)
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Class to hold statistics for a given collection.
Internal * next()
Advance the current position to the next document in the postlist.
string str(int value)
Convert int to std::string.
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
Xapian::termcount get_doclength() const
Return the length of current document.
Append a string to an object description, escaping invalid UTF-8.
The frequencies for a term.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Return document ids matching a range test on a specified doc value.
Various assertion macros.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Abstract base class for iterating term positions in a document.
Xapian::totallength total_length
Total length of all documents in the collection.
double get_weight() const
Return the weight contribution for the current position.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)