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


Loading...
Searching...
No Matches
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.
 
virtual ~TermScorer ()
 
virtual String getClassName ()
 
boost::shared_ptr< TermScorershared_from_this ()
 
virtual void score (const CollectorPtr &collector)
 Scores and collects all matching documents.
 
virtual int32_t docID ()
 Returns the following:
 
virtual int32_t nextDoc ()
 Advances to the next document matching the query. The iterator over the matching documents is buffered using TermDocs#read(Collection<int32_t>, Collection<int32_t>).
 
virtual double score ()
 Returns the score of the current document matching the query. Initially invalid, until nextDoc() or advance(int32_t) is called the first time, or when called from within Collector#collect.
 
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).
 
virtual String toString ()
 Returns a string representation of this TermScorer.
 
virtual float termFreq ()
 
- Public Member Functions inherited from Lucene::Scorer
 Scorer (const SimilarityPtr &similarity)
 Constructs a Scorer.
 
 Scorer (const WeightPtr &weight)
 
virtual ~Scorer ()
 
boost::shared_ptr< Scorershared_from_this ()
 
SimilarityPtr getSimilarity ()
 Returns the Similarity implementation used by this scorer.
 
void visitSubScorers (QueryPtr parent, BooleanClause::Occur relationship, ScorerVisitor *visitor)
 
void visitScorers (ScorerVisitor *visitor)
 
- Public Member Functions inherited from Lucene::DocIdSetIterator
virtual ~DocIdSetIterator ()
 
boost::shared_ptr< DocIdSetIteratorshared_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.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

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.
 
- 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
 
TermDocs__termDocs
 
ByteArray norms
 
double weightValue
 
int32_t doc
 
Collection< int32_t > docs
 
decltype(docs.get()) __docs
 
Collection< int32_t > freqs
 
decltype(freqs.get()) __freqs
 
int32_t freq
 
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

- Data Fields inherited from Lucene::Scorer
WeightPtr weight
 
- 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.
 

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
weightThe weight of the Term in the query.
tdAn iterator over the documents matching the Term.
similarityThe Similarity implementation to be used for score computations.
normsThe field norms of the document fields for the Term.

◆ ~TermScorer()

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

Member Function Documentation

◆ _getClassName()

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

◆ 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
targetThe 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:

Implements Lucene::DocIdSetIterator.

◆ getClassName()

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

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 TermDocs#read(Collection<int32_t>, Collection<int32_t>).

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 nextDoc() 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
collectorThe 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 
)
protectedvirtual

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

Parameters
collectorThe collector to which all matching documents are passed.
maxDo not score documents past this.
firstDocIDThe 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 ( )
staticprotected

◆ termFreq()

virtual float Lucene::TermScorer::termFreq ( )
inlinevirtual

Reimplemented from Lucene::Scorer.

◆ toString()

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

Returns a string representation of this TermScorer.

Reimplemented from Lucene::LuceneObject.

Field Documentation

◆ __docs

decltype(docs.get()) Lucene::TermScorer::__docs
protected

◆ __freqs

decltype(freqs.get()) Lucene::TermScorer::__freqs
protected

◆ __termDocs

TermDocs* Lucene::TermScorer::__termDocs
protected

◆ doc

int32_t Lucene::TermScorer::doc
protected

◆ docs

Collection<int32_t> Lucene::TermScorer::docs
protected

◆ freq

int32_t Lucene::TermScorer::freq
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
staticprotected

◆ 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:

clucene.sourceforge.net