xapian-core  2.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DocumentTermList Class Referencefinal

Iteration over terms in a document. More...

#include <documenttermlist.h>

+ Inheritance diagram for DocumentTermList:
+ Collaboration diagram for DocumentTermList:

Public Member Functions

 DocumentTermList (const Xapian::Document::Internal *doc_)
 
Xapian::termcount get_approx_size () const
 Return approximate size of this termlist. More...
 
Xapian::termcount get_wdf () const
 Return the wdf for the term at the current position. More...
 
Xapian::doccount get_termfreq () const
 Return the term frequency for the term at the current position. More...
 
const Xapian::VecCOW< Xapian::termpos > * get_vec_termpos () const
 Get pointer to VecCOW<termpos> if that's the internal representation. More...
 
PositionListpositionlist_begin () const
 Return PositionList for the current position. More...
 
Xapian::termcount positionlist_count () const
 Return the length of the position list for the current position. More...
 
TermListnext ()
 Advance the current position to the next term in the termlist. More...
 
TermListskip_to (std::string_view term)
 Skip forward to the specified term. More...
 
- Public Member Functions inherited from Xapian::TermIterator::Internal
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. More...
 
virtual void accumulate_stats (Xapian::Internal::ExpandStats &stats) const
 Collate weighting information for the current term. More...
 
const std::string & get_termname () const
 Return the termname at the current position. More...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Private Member Functions

void operator= (const DocumentTermList &)=delete
 Don't allow assignment. More...
 
 DocumentTermList (const DocumentTermList &)=delete
 Don't allow copying. More...
 

Private Attributes

Xapian::Internal::intrusive_ptr< const Xapian::Document::Internaldoc
 Document internals we're iterating over. More...
 
std::map< std::string, TermInfo, std::less<> >::const_iterator it
 Iterator over the map inside doc. More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::TermIterator::Internal
size_t shard_index = 0
 Which shard of a multidatabase this is from. More...
 
- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::TermIterator::Internal
 Internal ()
 Only constructable as a base class for derived classes. More...
 
- Protected Attributes inherited from Xapian::TermIterator::Internal
std::string current_term
 The current term. More...
 

Detailed Description

Iteration over terms in a document.

Definition at line 33 of file documenttermlist.h.

Constructor & Destructor Documentation

◆ DocumentTermList() [1/2]

DocumentTermList::DocumentTermList ( const DocumentTermList )
privatedelete

Don't allow copying.

◆ DocumentTermList() [2/2]

DocumentTermList::DocumentTermList ( const Xapian::Document::Internal doc_)
inlineexplicit

Definition at line 51 of file documenttermlist.h.

Member Function Documentation

◆ get_approx_size()

Xapian::termcount DocumentTermList::get_approx_size ( ) const
virtual

Return approximate size of this termlist.

Implements Xapian::TermIterator::Internal.

Definition at line 33 of file documenttermlist.cc.

References Assert.

◆ get_termfreq()

Xapian::doccount DocumentTermList::get_termfreq ( ) const
virtual

Return the term frequency for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 49 of file documenttermlist.cc.

◆ get_vec_termpos()

const Xapian::VecCOW< Xapian::termpos > * DocumentTermList::get_vec_termpos ( ) const
virtual

Get pointer to VecCOW<termpos> if that's the internal representation.

This avoids unnecessary copying of positions in the common cases - the case it doesn't help with is adding a document back with unmodified positions AND a different docid, which is an unusual thing to do.

Returns
Pointer to VecCOW<termpos> or NULL.

Reimplemented from Xapian::TermIterator::Internal.

Definition at line 55 of file documenttermlist.cc.

◆ get_wdf()

Xapian::termcount DocumentTermList::get_wdf ( ) const
virtual

Return the wdf for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 42 of file documenttermlist.cc.

References Assert.

◆ next()

TermList * DocumentTermList::next ( )
virtual

Advance the current position to the next term in the termlist.

The list starts before the first term in the list, so next(), skip_to() or check() must be called before any methods which need the context of the current position.

Returns
Normally returns NULL to indicate success. If the end has been reached, returns this; if another non-NULL pointer is returned then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::TermIterator::Internal.

Definition at line 73 of file documenttermlist.cc.

◆ operator=()

void DocumentTermList::operator= ( const DocumentTermList )
privatedelete

Don't allow assignment.

◆ positionlist_begin()

PositionList * DocumentTermList::positionlist_begin ( ) const
virtual

Return PositionList for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 61 of file documenttermlist.cc.

◆ positionlist_count()

Xapian::termcount DocumentTermList::positionlist_count ( ) const
virtual

Return the length of the position list for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 67 of file documenttermlist.cc.

◆ skip_to()

TermList * DocumentTermList::skip_to ( std::string_view  term)
virtual

Skip forward to the specified term.

If the specified term isn't in the list, position ourselves on the first term after term.

Returns
Normally returns NULL to indicate success. If no terms after term exist, returns this; if another non-NULL pointer is returned then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::TermIterator::Internal.

Definition at line 91 of file documenttermlist.cc.

References term.

Member Data Documentation

◆ doc

Xapian::Internal::intrusive_ptr<const Xapian::Document::Internal> DocumentTermList::doc
private

Document internals we're iterating over.

Definition at line 41 of file documenttermlist.h.

◆ it

std::map<std::string, TermInfo, std::less<> >::const_iterator DocumentTermList::it
private

Iterator over the map inside doc.

If we haven't started yet, this will be set to: doc->terms.end()

Definition at line 47 of file documenttermlist.h.


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