#include <postlist.h>


Public Member Functions | |
| virtual | ~Internal () |
| 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. | |
| virtual Xapian::doccount | get_termfreq_min () const =0 |
| Get a lower bound on the number of documents indexed by this term. | |
| virtual Xapian::doccount | get_termfreq_max () const =0 |
| Get an upper bound on the number of documents indexed by this term. | |
| virtual Xapian::doccount | get_termfreq_est () const =0 |
| Get an estimate of the number of documents indexed by this term. | |
| virtual TermFreqs | get_termfreq_est_using_stats (const Xapian::Weight::Internal &stats) const |
| Get an estimate for the termfreq and reltermfreq, given the stats. | |
| virtual Xapian::weight | get_maxweight () const =0 |
| Return an upper bound on what get_weight() can return. | |
| virtual Xapian::docid | get_docid () const =0 |
| Return the current docid. | |
| virtual Xapian::termcount | get_doclength () const =0 |
| Return the length of current document. | |
| virtual Xapian::termcount | get_wdf () const |
| Return the wdf for the document at the current position. | |
| virtual Xapian::weight | get_weight () const =0 |
| Return the weight contribution for the current position. | |
| virtual const std::string * | get_collapse_key () const |
| If the collapse key is already known, return it. | |
| virtual bool | at_end () const =0 |
| Return true if the current position is past the last entry in this list. | |
| virtual Xapian::weight | recalc_maxweight ()=0 |
| Recalculate the upper bound on what get_weight() can return. | |
| 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). | |
| 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). | |
| virtual Internal * | next (Xapian::weight w_min)=0 |
| Advance the current position to the next document in the postlist. | |
| virtual Internal * | skip_to (Xapian::docid, Xapian::weight w_min)=0 |
| Skip forward to the specified docid. | |
| virtual Internal * | check (Xapian::docid did, Xapian::weight w_min, bool &valid) |
| Check if the specified docid occurs in this postlist. | |
| Internal * | next () |
| Advance the current position to the next document in the postlist. | |
| Internal * | skip_to (Xapian::docid did) |
| Skip forward to the specified docid. | |
| virtual Xapian::termcount | count_matching_subqs () const |
| Count the number of leaf subqueries which match at the current position. | |
| virtual std::string | get_description () const =0 |
| Return a string description of this object. | |
Protected Member Functions | |
| Internal () | |
| Only constructable as a base class for derived classes. | |
Private Member Functions | |
| void | operator= (const Internal &) |
| Don't allow assignment. | |
| Internal (const Internal &) | |
| Don't allow copying. | |
Definition at line 35 of file postlist.h.
| Xapian::PostingIterator::Internal::Internal | ( | const Internal & | ) | [private] |
Don't allow copying.
| Xapian::PostingIterator::Internal::Internal | ( | ) | [inline, protected] |
| Xapian::PostingIterator::Internal::~Internal | ( | ) | [virtual] |
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.
Definition at line 33 of file postlist.cc.
| virtual bool Xapian::PostingIterator::Internal::at_end | ( | ) | const [pure virtual] |
Return true if the current position is past the last entry in this list.
Implemented in BrassPostList, ChertAllDocsModifiedPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by AndNotPostList::advance_to_next_match(), SynonymPostList::at_end(), SelectPostList::at_end(), OrPostList::at_end(), ExtraWeightPostList::at_end(), SelectPostList::check(), OrPostList::check(), SelectPostList::next(), OrPostList::next(), AndMaybePostList::process_next_or_skip_to(), SelectPostList::skip_to(), OrPostList::skip_to(), and AndMaybePostList::sync_rhs().
| virtual Internal* Xapian::PostingIterator::Internal::check | ( | Xapian::docid | did, | |
| Xapian::weight | w_min, | |||
| bool & | valid | |||
| ) | [virtual] |
Check if the specified docid occurs in this postlist.
The caller is required to ensure that the specified docid actually exists in the database.
This method acts like skip_to() if that can be done at little extra cost, in which case it then sets valid to true.
Otherwise it simply checks if a particular docid is present. If it is, valid is set to true. If it isn't, it sets valid to false, and leaves the position unspecified (and hence the result of calling methods which depends on the current position, such as get_docid(), are also unspecified). In this state, next() will advance to the first matching position after docid, and skip_to() will act as it would if the position was the first matching position after docid.
The default implementation calls skip_to().
Reimplemented in ExternalPostList, OrPostList, SelectPostList, ValueGePostList, and ValueRangePostList.
Referenced by SelectPostList::check(), check_handling_prune(), and MultiAndPostList::check_helper().
| virtual Xapian::termcount Xapian::PostingIterator::Internal::count_matching_subqs | ( | ) | const [virtual] |
Count the number of leaf subqueries which match at the current position.
Reimplemented in LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by SelectPostList::count_matching_subqs(), OrPostList::count_matching_subqs(), MultiXorPostList::count_matching_subqs(), MultiAndPostList::count_matching_subqs(), ExtraWeightPostList::count_matching_subqs(), AndNotPostList::count_matching_subqs(), and AndMaybePostList::count_matching_subqs().
| const string * Xapian::PostingIterator::Internal::get_collapse_key | ( | ) | const [virtual] |
If the collapse key is already known, return it.
This is implemented by MSetPostList (and MergePostList). Other subclasses rely on the default implementation which just returns NULL.
Reimplemented in MergePostList, and MSetPostList.
Definition at line 50 of file postlist.cc.
Referenced by Collapser::process().
| virtual std::string Xapian::PostingIterator::Internal::get_description | ( | ) | const [pure virtual] |
Return a string description of this object.
Implemented in BrassAllDocsPostList, BrassPostList, ChertAllDocsModifiedPostList, ChertAllDocsPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExactPhrasePostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, NearPostList, PhrasePostList, SelectPostList, SynonymPostList, ValueGePostList, and ValueRangePostList.
Referenced by SynonymPostList::get_description(), SelectPostList::get_description(), PhrasePostList::get_description(), NearPostList::get_description(), OrPostList::get_description(), MultiXorPostList::get_description(), MultiAndPostList::get_description(), ExtraWeightPostList::get_description(), ExactPhrasePostList::get_description(), AndNotPostList::get_description(), AndMaybePostList::get_description(), and MultiMatch::getorrecalc_maxweight().
| virtual Xapian::docid Xapian::PostingIterator::Internal::get_docid | ( | ) | const [pure virtual] |
Return the current docid.
Implemented in BrassPostList, ChertAllDocsModifiedPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by AndNotPostList::advance_to_next_match(), OrPostList::check(), MultiAndPostList::find_next_match(), SynonymPostList::get_docid(), SelectPostList::get_docid(), ExtraWeightPostList::get_docid(), OrPostList::next(), MultiXorPostList::next(), AndMaybePostList::process_next_or_skip_to(), OrPostList::skip_to(), MultiXorPostList::skip_to(), and AndMaybePostList::sync_rhs().
| virtual Xapian::termcount Xapian::PostingIterator::Internal::get_doclength | ( | ) | const [pure virtual] |
Return the length of current document.
Implemented in BrassAllDocsPostList, BrassPostList, ChertAllDocsModifiedPostList, ChertAllDocsPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by SynonymPostList::get_doclength(), SelectPostList::get_doclength(), OrPostList::get_doclength(), MultiXorPostList::get_doclength(), MultiAndPostList::get_doclength(), ExtraWeightPostList::get_doclength(), AndNotPostList::get_doclength(), AndMaybePostList::get_doclength(), ExtraWeightPostList::get_weight(), and LeafPostList::get_weight().
| virtual Xapian::weight Xapian::PostingIterator::Internal::get_maxweight | ( | ) | const [pure virtual] |
Return an upper bound on what get_weight() can return.
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by AndMaybePostList::AndMaybePostList(), SelectPostList::get_maxweight(), ExtraWeightPostList::get_maxweight(), AndNotPostList::get_maxweight(), MultiMatch::getorrecalc_maxweight(), and CmpMaxOrTerms::operator()().
| virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_est | ( | ) | const [pure virtual] |
Get an estimate of the number of documents indexed by this term.
It should always be true that: get_termfreq_min() <= get_termfreq_est() <= get_termfreq_max()
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExactPhrasePostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, NearPostList, PhrasePostList, SynonymPostList, and ValueRangePostList.
Referenced by SynonymPostList::get_termfreq_est(), PhrasePostList::get_termfreq_est(), NearPostList::get_termfreq_est(), OrPostList::get_termfreq_est(), MultiXorPostList::get_termfreq_est(), MultiAndPostList::get_termfreq_est(), ExtraWeightPostList::get_termfreq_est(), ExactPhrasePostList::get_termfreq_est(), AndNotPostList::get_termfreq_est(), AndMaybePostList::get_termfreq_est(), LocalSubMatch::make_synonym_postlist(), MultiAndPostList::MultiAndPostList(), ComparePostListTermFreqAscending::operator()(), MultiAndPostList::ComparePostListTermFreqAscending::operator()(), and OrPostList::OrPostList().
| TermFreqs Xapian::PostingIterator::Internal::get_termfreq_est_using_stats | ( | const Xapian::Weight::Internal & | stats | ) | const [virtual] |
Get an estimate for the termfreq and reltermfreq, given the stats.
The frequencies may be for a combination of databases, or for just the relevant documents, so the results need not lie in the bounds given by get_termfreq_min() and get_termfreq_max().
Reimplemented in LeafPostList, AndMaybePostList, AndNotPostList, ExactPhrasePostList, MultiAndPostList, MultiXorPostList, OrPostList, NearPostList, PhrasePostList, and ValueRangePostList.
Definition at line 36 of file postlist.cc.
Referenced by PhrasePostList::get_termfreq_est_using_stats(), NearPostList::get_termfreq_est_using_stats(), OrPostList::get_termfreq_est_using_stats(), MultiAndPostList::get_termfreq_est_using_stats(), ExactPhrasePostList::get_termfreq_est_using_stats(), AndNotPostList::get_termfreq_est_using_stats(), AndMaybePostList::get_termfreq_est_using_stats(), and LocalSubMatch::make_synonym_postlist().
| virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_max | ( | ) | const [pure virtual] |
Get an upper bound on the number of documents indexed by this term.
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by SynonymPostList::get_termfreq_max(), SelectPostList::get_termfreq_max(), OrPostList::get_termfreq_max(), MultiXorPostList::get_termfreq_max(), MultiAndPostList::get_termfreq_max(), ExtraWeightPostList::get_termfreq_max(), AndNotPostList::get_termfreq_max(), AndMaybePostList::get_termfreq_max(), AndNotPostList::get_termfreq_min(), and CmpMaxOrTerms::operator()().
| virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_min | ( | ) | const [pure virtual] |
Get a lower bound on the number of documents indexed by this term.
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by MultiMatch::get_mset(), MultiXorPostList::get_termfreq_max(), SynonymPostList::get_termfreq_min(), OrPostList::get_termfreq_min(), MultiAndPostList::get_termfreq_min(), ExtraWeightPostList::get_termfreq_min(), AndNotPostList::get_termfreq_min(), and AndMaybePostList::get_termfreq_min().
| Xapian::termcount Xapian::PostingIterator::Internal::get_wdf | ( | ) | const [virtual] |
Return the wdf for the document at the current position.
The default implementation throws Xapian::UnimplementedError.
Reimplemented in BrassAllDocsPostList, BrassPostList, ChertAllDocsPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, AndMaybePostList, AndNotPostList, ExactPhrasePostList, MergePostList, MultiAndPostList, MultiXorPostList, OrPostList, NearPostList, PhrasePostList, and SynonymPostList.
Definition at line 44 of file postlist.cc.
Referenced by SynonymPostList::get_wdf(), OrPostList::get_wdf(), MultiXorPostList::get_wdf(), MultiAndPostList::get_wdf(), AndNotPostList::get_wdf(), AndMaybePostList::get_wdf(), and LeafPostList::get_weight().
| virtual Xapian::weight Xapian::PostingIterator::Internal::get_weight | ( | ) | const [pure virtual] |
Return the weight contribution for the current position.
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by SelectPostList::get_weight(), OrPostList::get_weight(), MultiXorPostList::get_weight(), MultiAndPostList::get_weight(), ExtraWeightPostList::get_weight(), AndNotPostList::get_weight(), and AndMaybePostList::get_weight().
| Internal* Xapian::PostingIterator::Internal::next | ( | ) | [inline] |
Advance the current position to the next document in the postlist.
Any weight contribution is acceptable.
Definition at line 187 of file postlist.h.
References next().
Referenced by MultiXorPostList::next(), next(), FlintModifiedPostList::next(), ChertModifiedPostList::next(), ChertAllDocsModifiedPostList::next(), FlintModifiedPostList::skip_deletes(), ChertModifiedPostList::skip_deletes(), ChertAllDocsModifiedPostList::skip_deletes(), SelectPostList::skip_to(), MultiXorPostList::skip_to(), NetworkPostList::skip_to(), and InMemoryPostList::skip_to().
| virtual Internal* Xapian::PostingIterator::Internal::next | ( | Xapian::weight | w_min | ) | [pure virtual] |
Advance the current position to the next document in the postlist.
The list starts before the first entry in the list, so next() 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). |
Implemented in BrassPostList, ChertAllDocsModifiedPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, ValueGePostList, and ValueRangePostList.
Referenced by SelectPostList::next(), MultiXorPostList::next(), ExtraWeightPostList::next(), AndNotPostList::next(), AndMaybePostList::next(), next_handling_prune(), and MultiAndPostList::next_helper().
| virtual PositionList* Xapian::PostingIterator::Internal::open_position_list | ( | ) | const [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 in BrassAllDocsPostList, BrassPostList, ChertAllDocsPostList, ChertModifiedPostList, ChertPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, ExternalPostList, SelectPostList, and ValueRangePostList.
Referenced by SelectPostList::open_position_list().
| void Xapian::PostingIterator::Internal::operator= | ( | const Internal & | ) | [private] |
Don't allow assignment.
| virtual PositionList* Xapian::PostingIterator::Internal::read_position_list | ( | ) | [virtual] |
Read the position list for the term in the current document and return a pointer to it (owned by the PostList).
The default implementation throws Xapian::UnimplementedError.
Reimplemented in BrassAllDocsPostList, BrassPostList, ChertAllDocsPostList, ChertModifiedPostList, ChertPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, NetworkPostList, ContiguousAllDocsPostList, ExternalPostList, SelectPostList, and ValueRangePostList.
Referenced by SelectPostList::read_position_list().
| virtual Xapian::weight Xapian::PostingIterator::Internal::recalc_maxweight | ( | ) | [pure virtual] |
Recalculate the upper bound on what get_weight() can return.
If the tree has pruned, get_maxweight() may use cached values. Calling this method instead forces a full recalculation.
Note that this method may be called after the postlist has reached the end. In this situation, the method should return 0.
Implemented in MultiPostList, EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, and ValueRangePostList.
Referenced by QueryOptimiser::do_or_like(), MultiMatch::getorrecalc_maxweight(), SynonymPostList::recalc_maxweight(), SelectPostList::recalc_maxweight(), OrPostList::recalc_maxweight(), MultiXorPostList::recalc_maxweight(), MultiAndPostList::recalc_maxweight(), ExtraWeightPostList::recalc_maxweight(), AndNotPostList::recalc_maxweight(), and AndMaybePostList::recalc_maxweight().
| Internal* Xapian::PostingIterator::Internal::skip_to | ( | Xapian::docid | did | ) | [inline] |
Skip forward to the specified docid.
Any weight contribution is acceptable.
Definition at line 193 of file postlist.h.
References skip_to().
Referenced by skip_to().
| virtual Internal* Xapian::PostingIterator::Internal::skip_to | ( | Xapian::docid | , | |
| Xapian::weight | w_min | |||
| ) | [pure 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). |
Implemented in BrassPostList, ChertAllDocsModifiedPostList, ChertModifiedPostList, ChertPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, NetworkPostList, ContiguousAllDocsPostList, EmptyPostList, AndMaybePostList, AndNotPostList, ExternalPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, MultiXorPostList, OrPostList, SelectPostList, SynonymPostList, ValueGePostList, and ValueRangePostList.
Referenced by SelectPostList::skip_to(), MultiXorPostList::skip_to(), ExtraWeightPostList::skip_to(), AndNotPostList::skip_to(), AndMaybePostList::skip_to(), skip_to_handling_prune(), and MultiAndPostList::skip_to_helper().