|
xapian-core
2.0.0
|
PostList in a honey database. More...
#include <honey_postlist.h>
Inheritance diagram for HoneyPostList:
Collaboration diagram for HoneyPostList:Public Member Functions | |
| HoneyPostList (const HoneyDatabase *db_, std::string_view term_, HoneyCursor *cursor_) | |
| Create HoneyPostList from already positioned cursor_. More... | |
| ~HoneyPostList () | |
| bool | open_nearby_postlist (std::string_view term_, bool need_read_pos, LeafPostList *&pl) const |
| Open another postlist from the same database. More... | |
| Xapian::docid | get_docid () const |
| Return the current docid. More... | |
| Xapian::termcount | get_wdf () const |
| Return the wdf for the document at the current position. More... | |
| bool | at_end () const |
| Return true if the current position is past the last entry in this list. More... | |
| 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... | |
| PostList * | next (double w_min) |
| Advance the current position to the next document in the postlist. More... | |
| PostList * | skip_to (Xapian::docid did, double w_min) |
| Skip forward to the specified docid. More... | |
| Xapian::termcount | get_wdf_upper_bound () const |
| void | get_docid_range (Xapian::docid &first, Xapian::docid &last) const |
| Get the bounds on the range of docids this PostList can return. More... | |
| std::string | get_description () const |
| Return a string description of this object. More... | |
Public Member Functions inherited from LeafPostList | |
| ~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... | |
| 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 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 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... | |
Private Member Functions | |
| HoneyPostList & | operator= (const HoneyPostList &)=delete |
| Don't allow assignment. More... | |
| HoneyPostList (const HoneyPostList &)=delete | |
| Don't allow copying. More... | |
| bool | update_reader () |
| Update reader to use the chunk currently pointed to by cursor. More... | |
Private Attributes | |
| HoneyCursor * | cursor |
| Cursor on the postlist table. More... | |
| Honey::PostingChunkReader | reader |
| Xapian::docid | last_did |
| The highest document id in this posting list. More... | |
| const HoneyDatabase * | db |
| HoneyDatabase to get position table object from. More... | |
| Xapian::termcount | wdf_max |
| Maximum wdf for this postlist. More... | |
| bool | started = false |
| Needed so that first next() does nothing. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from LeafPostList | |
| 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 inherited from LeafPostList | |
| 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... | |
PostList in a honey database.
Definition at line 153 of file honey_postlist.h.
|
privatedelete |
Don't allow copying.
Referenced by open_nearby_postlist().
| HoneyPostList::HoneyPostList | ( | const HoneyDatabase * | db_, |
| std::string_view | term_, | ||
| HoneyCursor * | cursor_ | ||
| ) |
Create HoneyPostList from already positioned cursor_.
Definition at line 53 of file honey_postlist.cc.
References Assert, Honey::PostingChunkReader::assign(), LeafPostList::collfreq, HoneyCursor::current_tag, cursor, decode_initial_chunk_header(), Honey::PostingChunkReader::init(), last_did, mul_overflows(), p, HoneyCursor::read_tag(), reader, Xapian::Internal::PostList::termfreq, TOP_BIT_SET, and wdf_max.
| HoneyPostList::~HoneyPostList | ( | ) |
Definition at line 117 of file honey_postlist.cc.
References cursor.
|
virtual |
Return true if the current position is past the last entry in this list.
Implements Xapian::Internal::PostList.
Definition at line 158 of file honey_postlist.cc.
References cursor.
|
virtual |
Return a string description of this object.
Implements Xapian::Internal::PostList.
Reimplemented in HoneyPosPostList.
Definition at line 264 of file honey_postlist.cc.
References LeafPostList::term.
|
virtual |
Return the current docid.
Implements Xapian::Internal::PostList.
Definition at line 146 of file honey_postlist.cc.
References Honey::PostingChunkReader::get_docid(), and reader.
Referenced by open_position_list(), and HoneyPosPostList::read_position_list().
|
virtual |
Get the bounds on the range of docids this PostList can return.
| [out] | first | Set to a lower bound on the docids that can be returned, or not changed if there's no known lower bound (other than 1). |
| [out] | last | Set to an upper bound on the docids that can be returned, or not changed if there's no known upper bound (other than the highest used docid). |
The default implementation (PostList::get_docid_range()) does nothing, which is suitable when there's no known lower or upper bound.
Reimplemented from Xapian::Internal::PostList.
Definition at line 251 of file honey_postlist.cc.
References Assert, AssertRel, Honey::PostingChunkReader::get_docid(), last_did, reader, started, and Xapian::Internal::PostList::termfreq.
|
virtual |
Return the wdf for the document at the current position.
The default implementation throws Xapian::UnimplementedError.
Reimplemented from Xapian::Internal::PostList.
Definition at line 152 of file honey_postlist.cc.
References Honey::PostingChunkReader::get_wdf(), and reader.
|
virtual |
|
virtual |
Advance the current position to the next document in the postlist.
The list starts before the first entry in the list, so next(), skip_to() or check() must be called before any methods which need the context of the current position.
| w_min | The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore). |
Implements Xapian::Internal::PostList.
Definition at line 170 of file honey_postlist.cc.
References Assert, Honey::PostingChunkReader::at_end(), cursor, Honey::PostingChunkReader::get_docid(), last_did, HoneyCursor::next(), Honey::PostingChunkReader::next(), rare, reader, started, and update_reader().
|
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 from LeafPostList.
Definition at line 123 of file honey_postlist.cc.
References Assert, cursor, db, HoneyPostList(), and Honey::make_postingchunk_key().
|
virtual |
Read the position list for the term in the current document and return a pointer to it (not owned by the PostList).
The default implementation throws Xapian::UnimplementedError.
Reimplemented from Xapian::Internal::PostList.
Definition at line 164 of file honey_postlist.cc.
References db, get_docid(), HoneyPositionTable::open_position_list(), HoneyDatabase::position_table, and LeafPostList::term.
|
privatedelete |
Don't allow assignment.
|
virtual |
Skip forward to the specified docid.
If the specified docid isn't in the list, position ourselves on the first document after it (or at_end() if no greater docids are present).
| w_min | The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore). |
Implements Xapian::Internal::PostList.
Definition at line 200 of file honey_postlist.cc.
References HoneyCursor::after_end(), Assert, Honey::PostingChunkReader::at_end(), cursor, HoneyCursor::find_entry_ge(), last_did, Honey::make_postingchunk_key(), rare, reader, Honey::PostingChunkReader::skip_to(), started, LeafPostList::term, and update_reader().
|
private |
Update reader to use the chunk currently pointed to by cursor.
Definition at line 39 of file honey_postlist.cc.
References Honey::docid_from_key(), and term.
|
private |
Cursor on the postlist table.
Definition at line 161 of file honey_postlist.h.
Referenced by at_end(), HoneyPostList(), next(), open_nearby_postlist(), skip_to(), and ~HoneyPostList().
|
private |
HoneyDatabase to get position table object from.
Definition at line 169 of file honey_postlist.h.
Referenced by open_nearby_postlist(), and open_position_list().
|
private |
The highest document id in this posting list.
Definition at line 166 of file honey_postlist.h.
Referenced by get_docid_range(), HoneyPostList(), next(), and skip_to().
|
private |
Definition at line 163 of file honey_postlist.h.
Referenced by get_docid(), get_docid_range(), get_wdf(), HoneyPostList(), next(), and skip_to().
|
private |
Needed so that first next() does nothing.
FIXME: Can we arrange not to need this?
Definition at line 181 of file honey_postlist.h.
Referenced by get_docid_range(), next(), and skip_to().
|
private |
Maximum wdf for this postlist.
We store this for honey, so it's exact - not just an upper bound.
Definition at line 175 of file honey_postlist.h.
Referenced by get_wdf_upper_bound(), and HoneyPostList().