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


DocValues.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 DOCVALUES_H
8 #define DOCVALUES_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
22 class LPPAPI DocValues : public LuceneObject {
23 public:
25  virtual ~DocValues();
26 
28 
29 protected:
30  double minVal;
31  double maxVal;
32  double avgVal;
33  bool computed;
34 
35 public:
37 
41  virtual double doubleVal(int32_t doc) = 0;
42 
46  virtual int32_t intVal(int32_t doc);
47 
51  virtual int64_t longVal(int32_t doc);
52 
56  virtual String strVal(int32_t doc);
57 
59  virtual String toString(int32_t doc) = 0;
60 
62  virtual ExplanationPtr explain(int32_t doc);
63 
74  virtual CollectionValue getInnerArray();
75 
79  virtual double getMinValue();
80 
84  virtual double getMaxValue();
85 
89  virtual double getAverageValue();
90 
91 protected:
93  void compute();
94 };
95 
96 }
97 
98 #endif
Lucene::DocValues::avgVal
double avgVal
Definition: DocValues.h:32
Lucene::DocValues::toString
virtual String toString(int32_t doc)=0
Return a string representation of a doc value, as required for Explanations.
Lucene::DocValues::getInnerArray
virtual CollectionValue getInnerArray()
For test purposes only, return the inner array of values, or null if not applicable.
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::DocValues::intVal
virtual int32_t intVal(int32_t doc)
Return doc value as an int. Optional: DocValues implementation can (but don't have to) override this ...
Lucene::DocValues::DocValues
DocValues()
Lucene::DocValues::~DocValues
virtual ~DocValues()
Lucene::DocValues::getMinValue
virtual double getMinValue()
Returns the minimum of all values or NaN if this DocValues instance does not contain any value....
Lucene::DocValues::longVal
virtual int64_t longVal(int32_t doc)
Return doc value as a long. Optional: DocValues implementation can (but don't have to) override this ...
Lucene::DocValues::strVal
virtual String strVal(int32_t doc)
Return doc value as a string. Optional: DocValues implementation can (but don't have to) override thi...
Lucene::DocValues
Represents field values as different types. Normally created via a ValueSuorce for a particular field...
Definition: DocValues.h:22
Lucene::DocValues::explain
virtual ExplanationPtr explain(int32_t doc)
Explain the scoring value for the input doc.
Lucene::DocValues::doubleVal
virtual double doubleVal(int32_t doc)=0
Return doc value as a double. Mandatory: every DocValues implementation must implement at least this ...
Lucene::DocValues::compute
void compute()
Compute optional values.
Lucene::DocValues::getAverageValue
virtual double getAverageValue()
Returns the average of all values or NaN if this DocValues instance does not contain any value....
Lucene::DocValues::getMaxValue
virtual double getMaxValue()
Returns the maximum of all values or NaN if this DocValues instance does not contain any value....
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::DocValues::maxVal
double maxVal
Definition: DocValues.h:31
Lucene::DocValues::minVal
double minVal
Definition: DocValues.h:27
Lucene::DocValues::computed
bool computed
Definition: DocValues.h:33
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
Lucene::LuceneObject::toString
virtual String toString()
Returns a string representation of the object.
LuceneObject.h

clucene.sourceforge.net