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

SimilarityDelegator.h
Go to the documentation of this file.
1 // 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
Lucene::FieldInvertStatePtr
boost::shared_ptr< FieldInvertState > FieldInvertStatePtr
Definition: LuceneTypes.h:128
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::SimilarityDelegator
Delegating scoring implementation. Useful in Query#getSimilarity(Searcher) implementations,...
Definition: SimilarityDelegator.h:16
Similarity.h
Lucene::Similarity
Scoring API.
Definition: Similarity.h:427
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435

clucene.sourceforge.net