Xapian: API Documentation: Xapian::TermIterator Class Reference

xapian-core 2.0.0

Public Member Functions | List of all members
Xapian::TermIterator Class Reference

Class for iterating over a list of terms. More...

`#include <termiterator.h>`

## Public Member Functions
| TermIterator (const TermIterator &o)
| Copy constructor.
TermIterator & | operator= (const TermIterator &o)
| Assignment.
| TermIterator (TermIterator &&o)
| Move constructor.
TermIterator & | operator= (TermIterator &&o)
| Move assignment operator.
| TermIterator () noexcept
| Default constructor.
| ~TermIterator ()
| Destructor.
std::string | operator* () const
| Return the term at the current position.
Xapian::termcount | get_wdf () const
| Return the wdf for the term at the current position.
Xapian::doccount | get_termfreq () const
| Return the term frequency for the term at the current position.
Xapian::termcount | positionlist_count () const
| Return the length of the position list for the current position.
PositionIterator | positionlist_begin () const
| Return a PositionIterator for the current term.
PositionIterator | positionlist_end () const noexcept
| Return an end PositionIterator for the current term.
TermIterator & | operator++ ()
| Advance the iterator to the next position.
DerefWrapper_< std::string > | operator++ (int)
| Advance the iterator to the next position (postfix version).
void | skip_to (std::string_view term)
| Advance the iterator to term term.
std::string | get_description () const
| Return a string describing this object.

## Detailed Description

Class for iterating over a list of terms.

## Constructor & Destructor Documentation

## ◆ TermIterator()

Xapian::TermIterator::TermIterator | ( |  | ) |
| inlinenoexcept

Default constructor.

Creates an uninitialised iterator, which can't be used before being assigned to, but is sometimes syntactically convenient.

## Member Function Documentation

## ◆ get_termfreq()

Xapian::doccount Xapian::TermIterator::get_termfreq | ( |  | ) | const

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

Note that for a TermIterator returned by calling termlist_begin() on a Document object obtained from a sharded database, this method will return the term frequency from the shard that the document is in rather than for the combined database.

## ◆ skip_to()

void Xapian::TermIterator::skip_to | ( | std::string_view | term | ) |

Advance the iterator to term term.

If the iteration is over an unsorted list of terms, then this method will throw Xapian::InvalidOperationError.

Parameters

  term | The term to advance to. If this term isn't in the stream being iterated, then the iterator is moved to the next term after it which is.

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

- xapian/termiterator.h