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


Weight.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 WEIGHT_H
8 #define WEIGHT_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
30 class LPPAPI Weight : public LuceneObject {
31 public:
32  virtual ~Weight();
34 
35 public:
40  virtual ExplanationPtr explain(const IndexReaderPtr& reader, int32_t doc) = 0;
41 
43  virtual QueryPtr getQuery() = 0;
44 
46  virtual double getValue() = 0;
47 
49  virtual void normalize(double norm) = 0;
50 
68  virtual ScorerPtr scorer(const IndexReaderPtr& reader, bool scoreDocsInOrder, bool topScorer) = 0;
69 
71  virtual double sumOfSquaredWeights() = 0;
72 
79  virtual bool scoresDocsOutOfOrder();
80 };
81 
82 }
83 
84 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Weight::normalize
virtual void normalize(double norm)=0
Assigns the query normalization factor to this.
Lucene::Weight::sumOfSquaredWeights
virtual double sumOfSquaredWeights()=0
The sum of squared weights of contained query clauses.
Lucene::Weight::explain
virtual ExplanationPtr explain(const IndexReaderPtr &reader, int32_t doc)=0
An explanation of the score computation for the named document.
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
Lucene::Weight::getQuery
virtual QueryPtr getQuery()=0
The query that this concerns.
Lucene::Weight
Calculate query weights and build query scorers.
Definition: Weight.h:30
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::Weight::~Weight
virtual ~Weight()
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::ScorerPtr
boost::shared_ptr< Scorer > ScorerPtr
Definition: LuceneTypes.h:429
Lucene::Weight::scoresDocsOutOfOrder
virtual bool scoresDocsOutOfOrder()
Returns true if this implementation scores docs only out of order. This method is used in conjunction...
Lucene::Weight::scorer
virtual ScorerPtr scorer(const IndexReaderPtr &reader, bool scoreDocsInOrder, bool topScorer)=0
Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder.
Lucene::Weight::getValue
virtual double getValue()=0
The weight for this query.
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
LuceneObject.h

clucene.sourceforge.net