Scoring functionality for phrase queries. A document is considered matching if it contains the phrase-query terms at "valid" positions. What "valid positions" are depends on the type of the phrase query: for an exact phrase query terms are required to appear in adjacent locations, while for a sloppy phrase query some distance between the terms is allowed. The abstract method phraseFreq()
of extending classes is invoked for each document containing all the phrase query terms, in order to compute the frequency of the phrase query in that document. A non zero frequency means a match.
More...
#include <PhraseScorer.h>
|
bool | doNext () |
| Next without initial increment.
|
|
virtual double | phraseFreq ()=0 |
| For a document containing all the phrase query terms, compute the frequency of the phrase in that document. A non zero frequency means a match. Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations.
|
|
void | init () |
|
void | sort () |
|
void | pqToList () |
|
void | firstToLast () |
|
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.
|
|
| LuceneObject () |
|
Scoring functionality for phrase queries. A document is considered matching if it contains the phrase-query terms at "valid" positions. What "valid positions" are depends on the type of the phrase query: for an exact phrase query terms are required to appear in adjacent locations, while for a sloppy phrase query some distance between the terms is allowed. The abstract method phraseFreq()
of extending classes is invoked for each document containing all the phrase query terms, in order to compute the frequency of the phrase query in that document. A non zero frequency means a match.
◆ PhraseScorer()
◆ ~PhraseScorer()
virtual Lucene::PhraseScorer::~PhraseScorer |
( |
| ) |
|
|
virtual |
◆ _getClassName()
static String Lucene::PhraseScorer::_getClassName |
( |
| ) |
|
|
inlinestatic |
◆ advance()
virtual int32_t Lucene::PhraseScorer::advance |
( |
int32_t |
target | ) |
|
|
virtual |
Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS
if there are no more docs in the set.
Behaves as if written:
int32_t advance(int32_t target)
{
int32_t doc;
while ((doc = nextDoc()) < target)
{ }
return doc;
}
Some implementations are considerably more efficient than that.
NOTE: certain implementations may return a different value (each time) if called several times in a row with the same target.
NOTE: this method may be called with {@value NO_MORE_DOCS} for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behaviour.
Implements Lucene::DocIdSetIterator.
◆ currentFreq()
double Lucene::PhraseScorer::currentFreq |
( |
| ) |
|
◆ docID()
virtual int32_t Lucene::PhraseScorer::docID |
( |
| ) |
|
|
virtual |
◆ doNext()
bool Lucene::PhraseScorer::doNext |
( |
| ) |
|
|
protected |
Next without initial increment.
◆ firstToLast()
void Lucene::PhraseScorer::firstToLast |
( |
| ) |
|
|
protected |
◆ getClassName()
virtual String Lucene::PhraseScorer::getClassName |
( |
| ) |
|
|
inlinevirtual |
◆ init()
void Lucene::PhraseScorer::init |
( |
| ) |
|
|
protected |
◆ nextDoc()
virtual int32_t Lucene::PhraseScorer::nextDoc |
( |
| ) |
|
|
virtual |
Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS
if there are no more docs in the set.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behaviour.
Implements Lucene::DocIdSetIterator.
◆ phraseFreq()
virtual double Lucene::PhraseScorer::phraseFreq |
( |
| ) |
|
|
protectedpure virtual |
For a document containing all the phrase query terms, compute the frequency of the phrase in that document. A non zero frequency means a match. Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations.
- Returns
- frequency of the phrase in current doc, 0 if not found.
Implemented in Lucene::ExactPhraseScorer, and Lucene::SloppyPhraseScorer.
◆ pqToList()
void Lucene::PhraseScorer::pqToList |
( |
| ) |
|
|
protected |
◆ score()
virtual double Lucene::PhraseScorer::score |
( |
| ) |
|
|
virtual |
◆ shared_from_this()
boost::shared_ptr< PhraseScorer > Lucene::PhraseScorer::shared_from_this |
( |
| ) |
|
|
inline |
◆ sort()
void Lucene::PhraseScorer::sort |
( |
| ) |
|
|
protected |
◆ termFreq()
virtual float Lucene::PhraseScorer::termFreq |
( |
| ) |
|
|
inlinevirtual |
◆ toString()
virtual String Lucene::PhraseScorer::toString |
( |
| ) |
|
|
virtual |
◆ __first
◆ __last
◆ __weight
Weight* Lucene::PhraseScorer::__weight = nullptr |
|
protected |
◆ _holds
◆ firstTime
bool Lucene::PhraseScorer::firstTime |
|
protected |
◆ freq
double Lucene::PhraseScorer::freq |
|
protected |
◆ more
bool Lucene::PhraseScorer::more |
|
protected |
◆ norms
ByteArray Lucene::PhraseScorer::norms |
|
protected |
◆ pq
◆ value
double Lucene::PhraseScorer::value |
|
protected |
◆ weight
The documentation for this class was generated from the following file: