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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

DefaultSimilarity.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 DEFAULTSIMILARITY_H
8 #define DEFAULTSIMILARITY_H
9
10 #include "Similarity.h"
11
12 namespace Lucene {
13
15 class LPPAPI DefaultSimilarity : public Similarity {
16 public:
17 DefaultSimilarity();
18 virtual ~DefaultSimilarity();
19
20 LUCENE_CLASS(DefaultSimilarity);
21
22 protected:
23 bool discountOverlaps; // Default false
24
25 public:
29 virtual double computeNorm(const String& fieldName, const FieldInvertStatePtr& state);
30
32 virtual double lengthNorm(const String& fieldName, int32_t numTokens);
33
35 virtual double queryNorm(double sumOfSquaredWeights);
36
38 virtual double tf(double freq);
39
41 virtual double sloppyFreq(int32_t distance);
42
44 virtual double idf(int32_t docFreq, int32_t numDocs);
45
47 virtual double coord(int32_t overlap, int32_t maxOverlap);
48
52 void setDiscountOverlaps(bool v);
53
55 bool getDiscountOverlaps();
56 };
57
58 }
59
60 #endif
Similarity.h
Lucene::Similarity
Scoring API.
Definition: Similarity.h:427
Lucene::DefaultSimilarity
Default scoring implementation.
Definition: DefaultSimilarity.h:15
Lucene::FieldInvertStatePtr
boost::shared_ptr< FieldInvertState > FieldInvertStatePtr
Definition: LuceneTypes.h:128
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12

clucene.sourceforge.net