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

Loading...
Searching...
No Matches
SimilarityDelegator.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef SIMILARITYDELEGATOR_H
8#define SIMILARITYDELEGATOR_H
9
10#include "Similarity.h"
11
12 namespace Lucene {
13
16 class LPPAPI SimilarityDelegator : public Similarity {
17 public:
18 SimilarityDelegator(const SimilarityPtr& delegee);
19 virtual ~SimilarityDelegator();
20
21 LUCENE_CLASS(SimilarityDelegator);
22
23 protected:
24 SimilarityPtr delegee;
25
26 public:
27 virtual double computeNorm(const String& field, const FieldInvertStatePtr& state);
28 virtual double lengthNorm(const String& fieldName, int32_t numTokens);
29 virtual double queryNorm(double sumOfSquaredWeights);
30 virtual double tf(double freq);
31 virtual double sloppyFreq(int32_t distance);
32 virtual double idf(int32_t docFreq, int32_t numDocs);
33 virtual double coord(int32_t overlap, int32_t maxOverlap);
34 virtual double scorePayload(int32_t docId, const String& fieldName, int32_t start, int32_t end, ByteArray payload, int32_t offset, int32_t length);
35};
36
37}
38
39#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Similarity.h
Lucene::SimilarityDelegator
Delegating scoring implementation. Useful in Query#getSimilarity(Searcher) implementations,...
Definition SimilarityDelegator.h:16
Lucene::SimilarityDelegator::idf
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 t...
Lucene::SimilarityDelegator::computeNorm
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 ...
Lucene::SimilarityDelegator::coord
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....
Lucene::SimilarityDelegator::~SimilarityDelegator
virtual ~SimilarityDelegator()
Lucene::SimilarityDelegator::queryNorm
virtual double queryNorm(double sumOfSquaredWeights)
Computes the normalization value for a query given the sum of the squared weights of each of the quer...
Lucene::SimilarityDelegator::scorePayload
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...
Lucene::SimilarityDelegator::SimilarityDelegator
SimilarityDelegator(const SimilarityPtr &delegee)
Lucene::SimilarityDelegator::lengthNorm
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....
Lucene::SimilarityDelegator::tf
virtual double tf(double freq)
Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied...
Lucene::SimilarityDelegator::sloppyFreq
virtual double sloppyFreq(int32_t distance)
Computes the amount of a sloppy phrase match, based on an edit distance. This value is summed for eac...
Lucene::SimilarityDelegator::delegee
SimilarityPtr delegee
Definition SimilarityDelegator.h:24
Lucene::Similarity
Scoring API.
Definition Similarity.h:427
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::FieldInvertStatePtr
boost::shared_ptr< FieldInvertState > FieldInvertStatePtr
Definition LuceneTypes.h:128
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435

clucene.sourceforge.net