|
| SimilarityDelegator (const SimilarityPtr &delegee) |
|
virtual | ~SimilarityDelegator () |
|
virtual String | getClassName () |
|
boost::shared_ptr< SimilarityDelegator > | shared_from_this () |
|
virtual double | computeNorm (const String &field, const FieldInvertStatePtr &state) |
| Compute the normalization value for a field, given the accumulated state of term processing for this field (see FieldInvertState ).
|
|
virtual double | lengthNorm (const String &fieldName, int32_t numTokens) |
| Computes the normalization value for a field given the total number of terms contained in a field. These values, together with field boosts, are stored in an index and multiplied into scores for hits on each field by the search code.
|
|
virtual double | queryNorm (double sumOfSquaredWeights) |
| Computes the normalization value for a query given the sum of the squared weights of each of the query terms. This value is multiplied into the weight of each query term. While the classic query normalization factor is computed as 1/sqrt(sumOfSquaredWeights), other implementations might completely ignore sumOfSquaredWeights (ie return 1).
|
|
virtual double | tf (double freq) |
| Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied by the idf(int32_t, int32_t) factor for each term in the query and these products are then summed to form the initial score for a document.
|
|
virtual double | sloppyFreq (int32_t distance) |
| Computes the amount of a sloppy phrase match, based on an edit distance. This value is summed for each sloppy phrase match in a document to form the frequency that is passed to tf(double) .
|
|
virtual double | idf (int32_t docFreq, int32_t numDocs) |
| Computes a score factor based on a term's document frequency (the number of documents which contain the term). This value is multiplied by the tf(int32_t) factor for each term in the query and these products are then summed to form the initial score for a document.
|
|
virtual double | coord (int32_t overlap, int32_t maxOverlap) |
| Computes a score factor based on the fraction of all query terms that a document contains. This value is multiplied into scores.
|
|
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 responsible for interpreting what is in the payload. Lucene makes no assumptions about what is in the byte array.
|
|
| Similarity () |
|
virtual | ~Similarity () |
|
boost::shared_ptr< Similarity > | shared_from_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 by the idf(int32_t, int32_t) factor for each term in the query and these products are then summed to form the initial score for a document.
|
|
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 IDFExplanationPtr | idfExplain (Collection< TermPtr > terms, const SearcherPtr &searcher) |
| Computes a score factor for a phrase.
|
|
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.
|
|
virtual String | toString () |
| Returns a string representation of the object.
|
|
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.
|
|
Delegating scoring implementation. Useful in Query#getSimilarity(Searcher)
implementations, to override only certain methods of a Searcher's Similarity implementation.
virtual double Lucene::SimilarityDelegator::lengthNorm |
( |
const String & |
fieldName, |
|
|
int32_t |
numTokens |
|
) |
| |
|
virtual |
Computes the normalization value for a field given the total number of terms contained in a field. These values, together with field boosts, are stored in an index and multiplied into scores for hits on each field by the search code.
Matches in longer fields are less precise, so implementations of this method usually return smaller values when numTokens is large, and larger values when numTokens is small.
Note that the return values are computed under IndexWriter#addDocument(DocumentPtr)
and then stored using encodeNorm(double)
. Thus they have limited precision, and documents must be re-indexed if this method is altered.
- Parameters
-
fieldName | The name of the field |
numTokens | The total number of tokens contained in fields named fieldName of doc. |
- Returns
- A normalization factor for hits on this field of this document
- See also
- Field::setBoost(double)
Implements Lucene::Similarity.
virtual double Lucene::SimilarityDelegator::queryNorm |
( |
double |
sumOfSquaredWeights | ) |
|
|
virtual |
Computes the normalization value for a query given the sum of the squared weights of each of the query terms. This value is multiplied into the weight of each query term. While the classic query normalization factor is computed as 1/sqrt(sumOfSquaredWeights), other implementations might completely ignore sumOfSquaredWeights (ie return 1).
This does not affect ranking, but the default implementation does make scores from different queries more comparable than they would be by eliminating the magnitude of the Query vector as a factor in the score.
- Parameters
-
sumOfSquaredWeights | The sum of the squares of query term weights |
- Returns
- a normalization factor for query weights
Implements Lucene::Similarity.
virtual double Lucene::SimilarityDelegator::tf |
( |
double |
freq | ) |
|
|
virtual |
Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied by the idf(int32_t, int32_t)
factor for each term in the query and these products are then summed to form the initial score for a document.
Terms and phrases repeated in a document indicate the topic of the document, so implementations of this method usually return larger values when freq is large, and smaller values when freq is small.
- Parameters
-
freq | The frequency of a term within a document |
- Returns
- A score factor based on a term's within-document frequency
Implements Lucene::Similarity.