Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions
Lucene::TermFreqVector Class Reference

Provides access to stored term vector of a document field. The vector consists of the name of the field, an array of the terms that occur in the field of the `Document` and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the frequency of getTerms()[5], assuming there are at least 5 terms in the Document. More...

`#include <TermFreqVector.h>`

Inheritance diagram for Lucene::TermFreqVector:

## Public Member Functions

virtual | ~TermFreqVector ()
virtual String | getClassName ()
virtual String | getField ()
| The `Fieldable` name.
virtual int32_t | size ()
virtual Collection< String > | getTerms ()
virtual Collection< int32_t > | getTermFrequencies ()
| Array of term frequencies. Locations of the array correspond one to one to the terms in the array obtained from getTerms method. Each location in the array contains the number of times this term occurs in the document or the document field.
virtual int32_t | indexOf (const String &term)
| Return an index in the term numbers array returned from getTerms at which the term with the specified term appears. If this term does not appear in the array, return -1.
virtual Collection< int32_t > | indexesOf (Collection< String > terms, int32_t start, int32_t length)
| Just like indexOf(int) but searches for a number of terms at the same time. Returns an array that has the same size as the number of terms searched for, each slot containing the result of searching for that term number.

## Static Public Member Functions

static String | _getClassName ()

## Protected Member Functions

| TermFreqVector ()

## Detailed Description

Provides access to stored term vector of a document field. The vector consists of the name of the field, an array of the terms that occur in the field of the `Document` and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the frequency of getTerms()[5], assuming there are at least 5 terms in the Document.

## Constructor & Destructor Documentation

## ◆ TermFreqVector()

Lucene::TermFreqVector::TermFreqVector | ( |  | ) |

protected

## ◆ ~TermFreqVector()

virtual Lucene::TermFreqVector::~TermFreqVector | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

static String Lucene::TermFreqVector::_getClassName | ( |  | ) |

inline static

## ◆ getClassName()

virtual String Lucene::TermFreqVector::getClassName | ( |  | ) |

inline virtual

Reimplemented in Lucene::QueryTermVector, Lucene::SegmentTermPositionVector, Lucene::SegmentTermVector, and Lucene::TermPositionVector.

## ◆ getField()

virtual String Lucene::TermFreqVector::getField | ( |  | ) |

virtual

The `Fieldable` name.

Returns
  The name of the field this vector is associated with.

Reimplemented in Lucene::SegmentTermVector.

## ◆ getTermFrequencies()

virtual Collection< int32_t > Lucene::TermFreqVector::getTermFrequencies | ( |  | ) |

virtual

Array of term frequencies. Locations of the array correspond one to one to the terms in the array obtained from getTerms method. Each location in the array contains the number of times this term occurs in the document or the document field.

Reimplemented in Lucene::QueryTermVector, and Lucene::SegmentTermVector.

## ◆ getTerms()

virtual Collection< String > Lucene::TermFreqVector::getTerms | ( |  | ) |

virtual

Returns
  An Array of term texts in ascending order.

Reimplemented in Lucene::QueryTermVector, and Lucene::SegmentTermVector.

## ◆ indexesOf()

virtual Collection< int32_t > Lucene::TermFreqVector::indexesOf | ( | Collection< String > | terms,
|  | int32_t | start,
|  | int32_t | length
| ) |  |

virtual

Just like indexOf(int) but searches for a number of terms at the same time. Returns an array that has the same size as the number of terms searched for, each slot containing the result of searching for that term number.

Parameters

  terms | array containing terms to look for
  start | index in the array where the list of terms starts
  length | the number of terms in the list

Reimplemented in Lucene::SegmentTermVector, and Lucene::QueryTermVector.

## ◆ indexOf()

virtual int32_t Lucene::TermFreqVector::indexOf | ( | const String & | term | ) |

virtual

Return an index in the term numbers array returned from getTerms at which the term with the specified term appears. If this term does not appear in the array, return -1.

Reimplemented in Lucene::QueryTermVector, and Lucene::SegmentTermVector.

## ◆ size()

virtual int32_t Lucene::TermFreqVector::size | ( |  | ) |

virtual

Returns
  The number of terms in the term vector.

Reimplemented in Lucene::QueryTermVector, and Lucene::SegmentTermVector.

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

- TermFreqVector.h

clucene.sourceforge.net