34 range_start(range_start_),
52 return "Xapian::DecreasingValueWeightPostingSource";
66 const char *
pos = s.data();
67 const char * end =
pos + s.size();
153 return "DecreasingValueWeightPostingSource()";
An indexed database of documents.
Read weights from a value which is known to decrease as docid increases.
Xapian::docid range_end
End of range of docids for which weights are known to be decreasing.
double get_weight() const override
Return the weight contribution for the current document.
std::string name() const override
Name of the posting source class.
bool check(Xapian::docid min_docid, double min_wt) override
Check if the specified docid occurs.
double curr_weight
Weight at current position.
void reset(const Database &db_, Xapian::doccount shard_index) override
Set this PostingSource to the start of the list of postings.
void skip_to(Xapian::docid min_docid, double min_wt) override
Advance to the specified docid.
DecreasingValueWeightPostingSource(Xapian::valueno slot_, Xapian::docid range_start_=0, Xapian::docid range_end_=0)
Construct a DecreasingValueWeightPostingSource.
void skip_if_in_range(double min_wt)
Skip the iterator forward if in the decreasing range, and weight is low.
std::string get_description() const override
Return a string describing this object.
Xapian::docid range_start
Start of range of docids for which weights are known to be decreasing.
bool items_at_end
Flag, set to true if there are docs after the end of the range.
DecreasingValueWeightPostingSource * unserialise(const std::string &serialised) const override
Create object given string serialisation returned by serialise().
std::string serialise() const override
Serialise object parameters into a string.
void next(double min_wt) override
Advance the current position to the next matching document.
DecreasingValueWeightPostingSource * clone() const override
Clone the posting source.
void set_maxweight(double max_weight)
Specify an upper bound on what get_weight() will return from now on.
double get_maxweight() const noexcept
Return the currently set upper bound on what get_weight() can return.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
bool at_end() const
Return true if the current position is past the last entry in this list.
void next(double min_wt)
Advance the current position to the next matching document.
Xapian::Database get_database() const
The database we're reading values from.
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
Xapian::docid get_docid() const
Return the current docid.
Xapian::valueno get_slot() const
The slot we're reading values from.
void done()
End the iteration.
A posting source which reads weights from a value slot.
void reset(const Database &db_, Xapian::doccount shard_index)
Set this PostingSource to the start of the list of postings.
double get_weight() const
Return the weight contribution for the current document.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
void unpack_throw_serialisation_error(const char *p)
Throw appropriate SerialisationError.
Pack types into strings and unpack them again.
bool unpack_uint_last(const char **p, const char *end, U *result)
Decode an unsigned integer as the last item in a string.
void pack_uint_last(std::string &s, U value)
Append an encoded unsigned integer to a string as the last item.
bool unpack_uint(const char **p, const char *end, U *result)
Decode an unsigned integer from a string.
void pack_uint(std::string &s, U value)
Append an encoded unsigned integer to a string.
External sources of posting information.