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

Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
Lucene::TermScorer Class Reference

A Scorer for documents matching a Term. More...

`#include <TermScorer.h>`

Inheritance diagram for Lucene::TermScorer:

## Public Member Functions

| TermScorer (const WeightPtr &weight, const TermDocsPtr &td, const SimilarityPtr &similarity, ByteArray norms)
| Construct a TermScorer. More...
virtual | ~TermScorer ()
virtual String | getClassName ()
boost::shared_ptr< TermScorer > | shared_from_this ()
virtual void | score (const CollectorPtr &collector)
| Scores and collects all matching documents. More...
virtual int32_t | docID ()
| Returns the following: More...
virtual int32_t | nextDoc ()
| Advances to the next document matching the query. The iterator over the matching documents is buffered using {}. More...
virtual double | score ()
| Returns the score of the current document matching the query. Initially invalid, until {} or #advance(int32_t)} is called the first time, or when called from within Collector#collect}. More...
virtual int32_t | advance (int32_t target)
| Advances to the first match beyond the current whose document number is greater than or equal to a given target. The implementation uses TermDocs#skipTo(int32_t). More...
virtual String | toString ()
| Returns a string representation of this TermScorer. More...
Public Member Functions inherited from Lucene::Scorer
| Scorer (const SimilarityPtr &similarity)
| Constructs a Scorer. More...
virtual | ~Scorer ()
boost::shared_ptr< Scorer > | shared_from_this ()
SimilarityPtr | getSimilarity ()
| Returns the Similarity implementation used by this scorer. More...
Public Member Functions inherited from Lucene::DocIdSetIterator
virtual | ~DocIdSetIterator ()
boost::shared_ptr< DocIdSetIterator > | shared_from_this ()
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
Static Public Member Functions inherited from Lucene::Scorer
static String | _getClassName ()
Static Public Member Functions inherited from Lucene::DocIdSetIterator
static String | _getClassName ()

## Protected Member Functions

virtual bool | score (const CollectorPtr &collector, int32_t max, int32_t firstDocID)
| Collects matching documents in a range. Hook for optimization. Note, firstDocID is added to ensure that nextDoc() was called before this method. More...
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Static Protected Member Functions

static const Collection< double > | SIM_NORM_DECODER ()

## Protected Attributes

WeightPtr | weight
TermDocsPtr | termDocs
ByteArray | norms
double | weightValue
int32_t | doc
Collection< int32_t > | docs
Collection< int32_t > | freqs
int32_t | pointer
int32_t | pointerMax
Collection< double > | scoreCache
Protected Attributes inherited from Lucene::Scorer
SimilarityPtr | similarity
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Static Protected Attributes

static const int32_t | SCORE_CACHE_SIZE

## Additional Inherited Members

Static Public Attributes inherited from Lucene::DocIdSetIterator
static const int32_t | NO_MORE_DOCS
| When returned by nextDoc(), advance(int) and docID() it means there are no more docs in the iterator. More...

## Detailed Description

A Scorer for documents matching a Term.

## Constructor & Destructor Documentation

## ◆ TermScorer()

Lucene::TermScorer::TermScorer | ( | const WeightPtr & | weight,
|  | const TermDocsPtr & | td,
|  | const SimilarityPtr & | similarity,
|  | ByteArray | norms
| ) |  |

Construct a TermScorer.

Parameters

  weight | The weight of the Term in the query.
  td | An iterator over the documents matching the Term.
  similarity | The Similarity implementation to be used for score computations.
  norms | The field norms of the document fields for the Term.

## ◆ ~TermScorer()

virtual Lucene::TermScorer::~TermScorer | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

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

inline static

## ◆ advance()

virtual int32_t Lucene::TermScorer::advance | ( | int32_t | target | ) |

virtual

Advances to the first match beyond the current whose document number is greater than or equal to a given target. The implementation uses TermDocs#skipTo(int32_t).

Parameters

  target | The target document number.

Returns
  the matching document or -1 if none exist.

Implements Lucene::DocIdSetIterator.

## ◆ docID()

virtual int32_t Lucene::TermScorer::docID | ( |  | ) |

virtual

Returns the following:

- -1 or NO_MORE_DOCS if nextDoc() or advance(int) were not called yet.
- NO_MORE_DOCS if the iterator has exhausted.
- Otherwise it should return the doc ID it is currently on.

Implements Lucene::DocIdSetIterator.

## ◆ getClassName()

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

inline virtual

Reimplemented from Lucene::Scorer.

## ◆ nextDoc()

virtual int32_t Lucene::TermScorer::nextDoc | ( |  | ) |

virtual

Advances to the next document matching the query. The iterator over the matching documents is buffered using {}.

Returns
  the document matching the query or -1 if there are no more documents.

Implements Lucene::DocIdSetIterator.

## ◆ score() [1/3]

virtual double Lucene::TermScorer::score | ( |  | ) |

virtual

Returns the score of the current document matching the query. Initially invalid, until {} or #advance(int32_t)} is called the first time, or when called from within Collector#collect}.

Implements Lucene::Scorer.

## ◆ score() [2/3]

virtual void Lucene::TermScorer::score | ( | const CollectorPtr & | collector | ) |

virtual

Scores and collects all matching documents.

Parameters

  collector | The collector to which all matching documents are passed.

Reimplemented from Lucene::Scorer.

## ◆ score() [3/3]

virtual bool Lucene::TermScorer::score | ( | const CollectorPtr & | collector,
|  | int32_t | max,
|  | int32_t | firstDocID
| ) |  |

protected virtual

Collects matching documents in a range. Hook for optimization. Note, firstDocID is added to ensure that nextDoc() was called before this method.

Parameters

  collector | The collector to which all matching documents are passed.
  max | Do not score documents past this.
  firstDocID | The first document ID (ensures nextDoc() is called before this method.

Returns
  true if more matching documents may remain.

Reimplemented from Lucene::Scorer.

## ◆ shared_from_this()

boost::shared_ptr< TermScorer > Lucene::TermScorer::shared_from_this | ( |  | ) |

inline

## ◆ SIM_NORM_DECODER()

static const Collection<double> Lucene::TermScorer::SIM_NORM_DECODER | ( |  | ) |

static protected

## ◆ toString()

virtual String Lucene::TermScorer::toString | ( |  | ) |

virtual

Returns a string representation of this TermScorer.

Reimplemented from Lucene::LuceneObject.

## Field Documentation

## ◆ doc

int32_t Lucene::TermScorer::doc

protected

## ◆ docs

Collection<int32_t> Lucene::TermScorer::docs

protected

## ◆ freqs

Collection<int32_t> Lucene::TermScorer::freqs

protected

## ◆ norms

ByteArray Lucene::TermScorer::norms

protected

## ◆ pointer

int32_t Lucene::TermScorer::pointer

protected

## ◆ pointerMax

int32_t Lucene::TermScorer::pointerMax

protected

## ◆ SCORE_CACHE_SIZE

const int32_t Lucene::TermScorer::SCORE_CACHE_SIZE

static protected

## ◆ scoreCache

Collection<double> Lucene::TermScorer::scoreCache

protected

## ◆ termDocs

TermDocsPtr Lucene::TermScorer::termDocs

protected

## ◆ weight

WeightPtr Lucene::TermScorer::weight

protected

## ◆ weightValue

double Lucene::TermScorer::weightValue

protected

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

- TermScorer.h

clucene.sourceforge.net