|
xapian-core
2.0.0
|
Abstract base class for leaf postlists. More...
#include <leafpostlist.h>
Inheritance diagram for LeafPostList:
Collaboration diagram for LeafPostList:Public Member Functions | |
| ~LeafPostList () | |
| Xapian::termcount | get_collfreq () const |
| Get the collection frequency of the term. More... | |
| void | set_termweight (const Xapian::Weight *weight_) |
| Set the weighting scheme to use during matching. More... | |
| double | resolve_lazy_termweight (Xapian::Weight *weight_, Xapian::Weight::Internal *stats, Xapian::termcount qlen, Xapian::termcount wqf, double factor, const Xapian::Database::Internal *shard) |
| double | get_weight (Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const |
| Return the weight contribution for the current position. More... | |
| double | recalc_maxweight () |
| Recalculate the upper bound on what get_weight() can return. More... | |
| Xapian::termcount | count_matching_subqs () const |
| Count the number of leaf subqueries which match at the current position. More... | |
| void | gather_position_lists (OrPositionList *orposlist) |
| Gather PositionList* objects for a subtree. More... | |
| virtual bool | open_nearby_postlist (std::string_view term_, bool need_read_pos, LeafPostList *&pl) const |
| Open another postlist from the same database. More... | |
| virtual Xapian::termcount | get_wdf_upper_bound () const =0 |
| const std::string & | get_term () const |
| Get the term name. More... | |
| void | set_term (std::string_view term_) |
| Set the term name. More... | |
Public Member Functions inherited from Xapian::Internal::PostList | |
| virtual | ~PostList () |
| We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More... | |
| Xapian::doccount | get_termfreq () const |
| Get an estimate of the number of documents this PostList will return. More... | |
| virtual Xapian::docid | get_docid () const =0 |
| Return the current docid. More... | |
| virtual Xapian::termcount | get_wdf () const |
| Return the wdf for the document at the current position. More... | |
| virtual bool | at_end () const =0 |
| Return true if the current position is past the last entry in this list. More... | |
| virtual PositionList * | read_position_list () |
| Read the position list for the term in the current document and return a pointer to it (owned by the PostList). More... | |
| virtual PositionList * | open_position_list () const |
| Read the position list for the term in the current document and return a pointer to it (not owned by the PostList). More... | |
| virtual PostList * | next (double w_min)=0 |
| Advance the current position to the next document in the postlist. More... | |
| virtual PostList * | skip_to (Xapian::docid did, double w_min)=0 |
| Skip forward to the specified docid. More... | |
| virtual PostList * | check (Xapian::docid did, double w_min, bool &valid) |
| Check if the specified docid occurs in this postlist. More... | |
| PostList * | next () |
| Advance the current position to the next document in the postlist. More... | |
| PostList * | skip_to (Xapian::docid did) |
| Skip forward to the specified docid. More... | |
| virtual void | get_docid_range (docid &first, docid &last) const |
| Get the bounds on the range of docids this PostList can return. More... | |
| virtual std::string | get_description () const =0 |
| Return a string description of this object. More... | |
Protected Member Functions | |
| LeafPostList (std::string_view term_) | |
| Only constructable as a base class for derived classes. More... | |
Protected Member Functions inherited from Xapian::Internal::PostList | |
| PostList () | |
| Only constructable as a base class for derived classes. More... | |
Protected Attributes | |
| const Xapian::Weight * | weight = nullptr |
| std::string | term |
| The term name for this postlist (empty for an alldocs postlist). More... | |
| Xapian::termcount | collfreq |
| The collection frequency of the term. More... | |
Protected Attributes inherited from Xapian::Internal::PostList | |
| Xapian::doccount | termfreq |
| Estimate of the number of documents this PostList will return. More... | |
Private Member Functions | |
| void | operator= (const LeafPostList &)=delete |
| Don't allow assignment. More... | |
| LeafPostList (const LeafPostList &)=delete | |
| Don't allow copying. More... | |
Abstract base class for leaf postlists.
This class provides the following features in addition to the PostList class:
Definition at line 40 of file leafpostlist.h.
|
privatedelete |
Don't allow copying.
|
inlineexplicitprotected |
Only constructable as a base class for derived classes.
Definition at line 60 of file leafpostlist.h.
| LeafPostList::~LeafPostList | ( | ) |
Definition at line 33 of file leafpostlist.cc.
|
virtual |
Count the number of leaf subqueries which match at the current position.
Reimplemented from Xapian::Internal::PostList.
Definition at line 57 of file leafpostlist.cc.
|
virtual |
Gather PositionList* objects for a subtree.
Reimplemented from Xapian::Internal::PostList.
Definition at line 63 of file leafpostlist.cc.
References OrPositionList::add_poslist().
|
inline |
Get the collection frequency of the term.
This is the sum of wdf values for the term in all documents.
Definition at line 70 of file leafpostlist.h.
References collfreq.
Referenced by LocalSubMatch::register_lazy_postlist_for_stats().
|
inline |
Get the term name.
Definition at line 148 of file leafpostlist.h.
References term.
Referenced by LocalSubMatch::register_lazy_postlist_for_stats().
|
pure virtual |
Implemented in NetworkPostList, InMemoryAllDocsPostList, InMemoryPostList, HoneyPostList, HoneyAllDocsPostList, GlassPostList, and ContiguousAllDocsPostList.
Referenced by Xapian::Weight::init_().
|
virtual |
Return the weight contribution for the current position.
Implements Xapian::Internal::PostList.
Definition at line 39 of file leafpostlist.cc.
References AssertRel.
|
virtual |
Open another postlist from the same database.
| term_ | The term to open a postlist for (must not be an empty string). If term_ is near to this postlist's term, then this can be a lot more efficient (and if it isn't very near, there's not much of a penalty). Using this method can make a wildcard expansion much more memory efficient. | |
| need_read_pos | Does the postlist need to support read_position_list()? Note that open_position_list() may still be called even if need_read_pos is false. | |
| [out] | pl | If true is returned, set to a new LeafPostList object (or may be set to NULL if the term doesn't index any documents). The caller takes ownership of the returned object. |
Reimplemented in HoneyPostList, and GlassPostList.
Definition at line 69 of file leafpostlist.cc.
Referenced by LocalSubMatch::open_post_list().
|
privatedelete |
Don't allow assignment.
|
virtual |
Recalculate the upper bound on what get_weight() can return.
The maximum weight that get_weight() can return can decrease as the match progresses (typically when the PostList tree prunes) - calling this method calculates a current upper bound.
Note that this method may be called after the postlist has reached the end. In this situation, the method should return 0.
Implements Xapian::Internal::PostList.
Definition at line 51 of file leafpostlist.cc.
|
inline |
Definition at line 87 of file leafpostlist.h.
References Assert, Xapian::Weight::get_maxpart(), Xapian::Internal::PostList::get_termfreq(), Xapian::Weight::init_(), term, Xapian::Weight::Internal::termfreqs, and weight.
|
inline |
Set the term name.
This is used when we optimise a term matching all documents to an all documents postlist so that postlist reports the correct termname.
Definition at line 155 of file leafpostlist.h.
References term.
Referenced by LocalSubMatch::open_post_list().
|
inline |
Set the weighting scheme to use during matching.
If this isn't called, get_weight() and recalc_maxweight() will both return 0.
You should not call this more than once on a particular object.
| weight_ | The weighting object to use. Must not be NULL. |
Definition at line 81 of file leafpostlist.h.
References Assert, and weight.
Referenced by LocalSubMatch::open_post_list().
|
protected |
The collection frequency of the term.
This is the sum of wdf values for the term in all documents.
Definition at line 57 of file leafpostlist.h.
Referenced by get_collfreq(), HoneyPostList::HoneyPostList(), GlassPostList::init(), and InMemoryPostList::InMemoryPostList().
|
protected |
The term name for this postlist (empty for an alldocs postlist).
Definition at line 51 of file leafpostlist.h.
Referenced by GlassPostList::get_description(), HoneyPostList::get_description(), HoneyPosPostList::get_description(), InMemoryPostList::get_description(), get_term(), GlassPostList::get_wdf_upper_bound(), GlassPostList::init(), GlassPostList::move_to_chunk_containing(), GlassPostList::next_chunk(), GlassPostList::open_position_list(), HoneyPostList::open_position_list(), GlassPostList::read_position_list(), HoneyPosPostList::read_position_list(), resolve_lazy_termweight(), set_term(), and HoneyPostList::skip_to().
|
protected |
Definition at line 48 of file leafpostlist.h.
Referenced by resolve_lazy_termweight(), and set_termweight().