484 virtual double lengthNorm(
const String& fieldName, int32_t numTokens) = 0;
497 virtual double queryNorm(
double sumOfSquaredWeights) = 0;
521 virtual double tf(int32_t freq);
544 virtual double tf(
double freq) = 0;
583 virtual double idf(int32_t docFreq, int32_t numDocs) = 0;
595 virtual double coord(int32_t overlap, int32_t maxOverlap) = 0;
611 virtual double scorePayload(int32_t docId,
const String& fieldName, int32_t start, int32_t end, ByteArray payload, int32_t offset, int32_t length);
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Base class for all Lucene classes.
Definition LuceneObject.h:31
Scoring API.
Definition Similarity.h:427
virtual IDFExplanationPtr idfExplain(Collection< TermPtr > terms, const SearcherPtr &searcher)
Computes a score factor for a phrase.
virtual double lengthNorm(const String &fieldName, int32_t numTokens)=0
Computes the normalization value for a field given the total number of terms contained in a field....
virtual double computeNorm(const String &fieldName, const FieldInvertStatePtr &state)
Compute the normalization value for a field, given the accumulated state of term processing for this ...
virtual double tf(int32_t freq)
Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied...
virtual IDFExplanationPtr idfExplain(const TermPtr &term, const SearcherPtr &searcher)
Computes a score factor for a simple term and returns an explanation for that score factor.
virtual double idf(int32_t docFreq, int32_t numDocs)=0
Computes a score factor based on a term's document frequency (the number of documents which contain t...
static uint8_t encodeNorm(double f)
Encodes a normalization factor for storage in an index.
static double decodeNorm(uint8_t b)
Decodes a normalization factor stored in an index.
virtual double scorePayload(int32_t docId, const String &fieldName, int32_t start, int32_t end, ByteArray payload, int32_t offset, int32_t length)
Calculate a scoring factor based on the data in the payload. Overriding implementations are responsib...
virtual double sloppyFreq(int32_t distance)=0
Computes the amount of a sloppy phrase match, based on an edit distance. This value is summed for eac...
virtual double tf(double freq)=0
Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied...
virtual double queryNorm(double sumOfSquaredWeights)=0
Computes the normalization value for a query given the sum of the squared weights of each of the quer...
static const int32_t NO_DOC_ID_PROVIDED
Definition Similarity.h:435
static SimilarityPtr getDefault()
Return the default Similarity implementation used by indexing and search code. This is initially an i...
virtual double coord(int32_t overlap, int32_t maxOverlap)=0
Computes a score factor based on the fraction of all query terms that a document contains....
static const Collection< double > & getNormDecoder()
Returns a table for decoding normalization bytes.
static const Collection< double > NORM_TABLE
Definition Similarity.h:438
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< Searcher > SearcherPtr
Definition LuceneTypes.h:434
boost::shared_ptr< FieldInvertState > FieldInvertStatePtr
Definition LuceneTypes.h:128
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435
boost::shared_ptr< Term > TermPtr
Definition LuceneTypes.h:233
boost::shared_ptr< IDFExplanation > IDFExplanationPtr
Definition LuceneTypes.h:372