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


lucene::search::Scorer Class Reference

Expert: Implements scoring for a class of queries. More...

#include <Scorer.h>

Inheritance diagram for lucene::search::Scorer:
lucene::debug::LuceneBase lucene::search::BooleanScorer lucene::search::ConjunctionScorer lucene::search::PhraseScorer lucene::search::TermScorer lucene::search::ExactPhraseScorer lucene::search::SloppyPhraseScorer

List of all members.

Public Member Functions

virtual ~Scorer ()
SimilaritygetSimilarity () const
 Returns the Similarity implementation used by this scorer.
void score (HitCollector *hc)
 Scores all documents and passes them to a collector.
virtual bool next ()=0
 Advance to the next document matching the query.
virtual int32_t doc () const =0
 Returns the current document number.
virtual float_t score ()=0
 Returns the score of the current document.
virtual bool skipTo (int32_t target)=0
 Skips to the first match beyond the current whose document number is greater than or equal to target.
virtual void explain (int32_t doc, Explanation *ret)=0
 Returns an explanation of the score for doc.
virtual TCHAR * toString ()=0
 Returns an string which explains the object.

Protected Member Functions

 Scorer (Similarity *similarity)
 Constructs a Scorer.

Detailed Description

Expert: Implements scoring for a class of queries.


Constructor & Destructor Documentation

lucene::search::Scorer::Scorer ( Similarity similarity  )  [inline, protected]

Constructs a Scorer.

virtual lucene::search::Scorer::~Scorer (  )  [inline, virtual]

Member Function Documentation

virtual int32_t lucene::search::Scorer::doc (  )  const [pure virtual]

Returns the current document number.

Initially invalid, until next() is called the first time.

Implemented in lucene::search::BooleanScorer, lucene::search::ConjunctionScorer, lucene::search::PhraseScorer, and lucene::search::TermScorer.

virtual void lucene::search::Scorer::explain ( int32_t  doc,
Explanation ret 
) [pure virtual]
Similarity* lucene::search::Scorer::getSimilarity (  )  const [inline]

Returns the Similarity implementation used by this scorer.

virtual bool lucene::search::Scorer::next (  )  [pure virtual]

Advance to the next document matching the query.

Returns true iff there is another match.

Implemented in lucene::search::BooleanScorer, lucene::search::ConjunctionScorer, lucene::search::PhraseScorer, and lucene::search::TermScorer.

virtual float_t lucene::search::Scorer::score (  )  [pure virtual]

Returns the score of the current document.

Initially invalid, until next() is called the first time.

Implemented in lucene::search::BooleanScorer, lucene::search::ConjunctionScorer, lucene::search::PhraseScorer, and lucene::search::TermScorer.

void lucene::search::Scorer::score ( HitCollector hc  )  [inline]

Scores all documents and passes them to a collector.

References lucene::search::HitCollector::collect().

virtual bool lucene::search::Scorer::skipTo ( int32_t  target  )  [pure virtual]

Skips to the first match beyond the current whose document number is greater than or equal to target.

Returns true iff there is such a match.

Behaves as if written:

   boolean skipTo(int32_t target) {
     do {
       if (!next())
 	     return false;
     } while (target > doc());
     return true;
   }
 

Most implementations are considerably more efficient than that.

Implemented in lucene::search::BooleanScorer, lucene::search::ConjunctionScorer, lucene::search::PhraseScorer, and lucene::search::TermScorer.

virtual TCHAR* lucene::search::Scorer::toString (  )  [pure virtual]

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

clucene.sourceforge.net