xapian-core  2.0.0
Public Member Functions | Private Attributes | List of all members
PostListTree Class Reference

#include <postlisttree.h>

+ Collaboration diagram for PostListTree:

Public Member Functions

 PostListTree (ValueStreamDocument &vsdoc_, Xapian::Database &db_, const Xapian::Weight &wtscheme)
 
void delete_postlists ()
 Delete all the PostList objects. More...
 
 ~PostListTree ()
 
bool * get_max_weight_cached_flag_ptr ()
 Return pointer to flag to set to false to invalidate cached max weight. More...
 
void set_postlists (PostList **pls, Xapian::doccount n_shards_)
 
double recalc_maxweight ()
 
void force_recalc ()
 
Xapian::docid get_docid () const
 
Xapian::termcount get_doclength (Xapian::docid shard_did) const
 
double get_weight () const
 
bool next (double w_min)
 Return false if we're done. More...
 
void get_doc_stats (Xapian::docid shard_did, Xapian::termcount &doclen, Xapian::termcount &unique_terms, Xapian::termcount &wdfdocmax) const
 
Xapian::termcount count_matching_subqs () const
 
std::string get_description () const
 

Private Attributes

PostListpl = NULL
 
bool use_cached_max_weight = false
 
bool need_doclength
 
bool need_unique_terms
 
bool need_wdfdocmax
 
double max_weight
 
Xapian::doccount current_shard = 0
 The current shard. More...
 
PostList ** shard_pls = NULL
 The postlists for the shards. More...
 
Xapian::doccount n_shards = 0
 The number of shards. More...
 
ValueStreamDocumentvsdoc
 Document proxy used for valuestream caching. More...
 
Xapian::Databasedb
 
Xapian::Database::Internalshard_db = nullptr
 

Detailed Description

Definition at line 28 of file postlisttree.h.

Constructor & Destructor Documentation

◆ PostListTree()

PostListTree::PostListTree ( ValueStreamDocument vsdoc_,
Xapian::Database db_,
const Xapian::Weight wtscheme 
)
inline

Definition at line 67 of file postlisttree.h.

◆ ~PostListTree()

PostListTree::~PostListTree ( )
inline

Definition at line 84 of file postlisttree.h.

References delete_postlists().

Member Function Documentation

◆ count_matching_subqs()

Xapian::termcount PostListTree::count_matching_subqs ( ) const
inline

Definition at line 202 of file postlisttree.h.

References Xapian::Internal::PostList::count_matching_subqs(), and pl.

Referenced by ProtoMSet::update_max_weight().

◆ delete_postlists()

void PostListTree::delete_postlists ( )
inline

Delete all the PostList objects.

Definition at line 77 of file postlisttree.h.

References n_shards, and shard_pls.

Referenced by Matcher::get_local_mset(), and ~PostListTree().

◆ force_recalc()

void PostListTree::force_recalc ( )
inline

◆ get_description()

std::string PostListTree::get_description ( ) const
inline

◆ get_doc_stats()

void PostListTree::get_doc_stats ( Xapian::docid  shard_did,
Xapian::termcount doclen,
Xapian::termcount unique_terms,
Xapian::termcount wdfdocmax 
) const
inline

◆ get_docid()

Xapian::docid PostListTree::get_docid ( ) const
inline

◆ get_doclength()

Xapian::termcount PostListTree::get_doclength ( Xapian::docid  shard_did) const
inline

Definition at line 133 of file postlisttree.h.

References Xapian::Database::Internal::get_doclength(), and shard_db.

◆ get_max_weight_cached_flag_ptr()

bool* PostListTree::get_max_weight_cached_flag_ptr ( )
inline

Return pointer to flag to set to false to invalidate cached max weight.

Used with ExternalPostList, which wraps a PostingSource object.

Definition at line 92 of file postlisttree.h.

References use_cached_max_weight.

Referenced by Xapian::Internal::QueryPostingSource::postlist().

◆ get_weight()

double PostListTree::get_weight ( ) const
inline

◆ next()

bool PostListTree::next ( double  w_min)
inline

◆ recalc_maxweight()

double PostListTree::recalc_maxweight ( )
inline

Definition at line 111 of file postlisttree.h.

References current_shard, max_weight, n_shards, shard_pls, and use_cached_max_weight.

Referenced by Matcher::get_local_mset(), and next().

◆ set_postlists()

void PostListTree::set_postlists ( PostList **  pls,
Xapian::doccount  n_shards_ 
)
inline

Member Data Documentation

◆ current_shard

Xapian::doccount PostListTree::current_shard = 0
private

The current shard.

Definition at line 42 of file postlisttree.h.

Referenced by get_description(), get_docid(), next(), recalc_maxweight(), and set_postlists().

◆ db

Xapian::Database& PostListTree::db
private

Definition at line 62 of file postlisttree.h.

Referenced by next(), and set_postlists().

◆ max_weight

double PostListTree::max_weight
private

Definition at line 39 of file postlisttree.h.

Referenced by recalc_maxweight().

◆ n_shards

Xapian::doccount PostListTree::n_shards = 0
private

The number of shards.

Definition at line 53 of file postlisttree.h.

Referenced by delete_postlists(), get_description(), get_docid(), next(), recalc_maxweight(), and set_postlists().

◆ need_doclength

bool PostListTree::need_doclength
private

Definition at line 33 of file postlisttree.h.

Referenced by get_doc_stats().

◆ need_unique_terms

bool PostListTree::need_unique_terms
private

Definition at line 35 of file postlisttree.h.

Referenced by get_doc_stats().

◆ need_wdfdocmax

bool PostListTree::need_wdfdocmax
private

Definition at line 37 of file postlisttree.h.

Referenced by get_doc_stats().

◆ pl

PostList* PostListTree::pl = NULL
private

Definition at line 29 of file postlisttree.h.

Referenced by count_matching_subqs(), get_docid(), get_weight(), next(), and set_postlists().

◆ shard_db

Xapian::Database::Internal* PostListTree::shard_db = nullptr
private

Definition at line 64 of file postlisttree.h.

Referenced by get_doc_stats(), get_doclength(), next(), and set_postlists().

◆ shard_pls

PostList** PostListTree::shard_pls = NULL
private

The postlists for the shards.

Entries corresponding to remote shards will be NULL - the results from remote shards are included by merging MSet objects, rather than via the PostList tree.

Definition at line 50 of file postlisttree.h.

Referenced by delete_postlists(), get_description(), next(), recalc_maxweight(), and set_postlists().

◆ use_cached_max_weight

bool PostListTree::use_cached_max_weight = false
private

◆ vsdoc

ValueStreamDocument& PostListTree::vsdoc
private

Document proxy used for valuestream caching.

Each time we move to a new shard we must notify this object so it can invalidate any cached valuestreams (which are specific to the shard).

Definition at line 60 of file postlisttree.h.

Referenced by next(), and set_postlists().


The documentation for this class was generated from the following file: