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


Explanation.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 EXPLANATION_H
8 #define EXPLANATION_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI Explanation : public LuceneObject {
16 public:
17  Explanation(double value = 0, const String& description = EmptyString);
18  virtual ~Explanation();
19 
21 
22 protected:
23  double value; // the value of this node
24  String description; // what it represents
25  Collection<ExplanationPtr> details; // sub-explanations
26 
27 public:
33  virtual bool isMatch();
34 
36  virtual double getValue();
37 
39  virtual void setValue(double value);
40 
42  virtual String getDescription();
43 
45  virtual void setDescription(const String& description);
46 
48  virtual Collection<ExplanationPtr> getDetails();
49 
51  virtual void addDetail(const ExplanationPtr& detail);
52 
54  virtual String toString();
55 
57  virtual String toHtml();
58 
59 protected:
62  virtual String getSummary();
63 
64  virtual String toString(int32_t depth);
65 };
66 
70 class LPPAPI IDFExplanation : public LuceneObject {
71 public:
72  virtual ~IDFExplanation();
74 
75 public:
77  virtual double getIdf() = 0;
78 
81  virtual String explain() = 0;
82 };
83 
84 }
85 
86 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Collection< ExplanationPtr >
Lucene::IDFExplanation
Small Util class used to pass both an idf factor as well as an explanation for that factor.
Definition: Explanation.h:70
Lucene::Explanation::description
String description
Definition: Explanation.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::Explanation
Describes the score computation for document and query.
Definition: Explanation.h:15
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::Explanation::details
Collection< ExplanationPtr > details
Definition: Explanation.h:25
Lucene::Explanation::value
double value
Definition: Explanation.h:20
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
LuceneObject.h

clucene.sourceforge.net