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


SpanWeight.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 SPANWEIGHT_H
8 #define SPANWEIGHT_H
9 
10 #include "Weight.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI SpanWeight : public Weight {
16 public:
17  SpanWeight(const SpanQueryPtr& query, const SearcherPtr& searcher);
18  virtual ~SpanWeight();
19 
21 
22 protected:
24  double value;
25  double idf;
26  double queryNorm;
27  double queryWeight;
28 
29  SetTerm terms;
32 
33 public:
34  virtual QueryPtr getQuery();
35  virtual double getValue();
36  virtual double sumOfSquaredWeights();
37  virtual void normalize(double norm);
38  virtual ScorerPtr scorer(const IndexReaderPtr& reader, bool scoreDocsInOrder, bool topScorer);
39  virtual ExplanationPtr explain(const IndexReaderPtr& reader, int32_t doc);
40 
41  friend class PayloadNearSpanScorer;
42  friend class PayloadTermSpanScorer;
43 };
44 
45 }
46 
47 #endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: PayloadNearQuery.h:63
Public for use by other weight implementations.
Definition: SpanWeight.h:15
virtual double sumOfSquaredWeights()
The sum of squared weights of contained query clauses.
IDFExplanationPtr idfExp
Definition: SpanWeight.h:31
double queryWeight
Definition: SpanWeight.h:27
double queryNorm
Definition: SpanWeight.h:26
virtual ExplanationPtr explain(const IndexReaderPtr &reader, int32_t doc)
An explanation of the score computation for the named document.
virtual ScorerPtr scorer(const IndexReaderPtr &reader, bool scoreDocsInOrder, bool topScorer)
Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder.
SpanQueryPtr query
Definition: SpanWeight.h:30
double value
Definition: SpanWeight.h:24
virtual QueryPtr getQuery()
The query that this concerns.
virtual double getValue()
The weight for this query.
virtual ~SpanWeight()
SimilarityPtr similarity
Definition: SpanWeight.h:20
SetTerm terms
Definition: SpanWeight.h:29
virtual void normalize(double norm)
Assigns the query normalization factor to this.
SpanWeight(const SpanQueryPtr &query, const SearcherPtr &searcher)
double idf
Definition: SpanWeight.h:25
Calculate query weights and build query scorers.
Definition: Weight.h:30
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition: LuceneTypes.h:450
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
boost::shared_ptr< IDFExplanation > IDFExplanationPtr
Definition: LuceneTypes.h:372
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
boost::shared_ptr< Scorer > ScorerPtr
Definition: LuceneTypes.h:429

clucene.sourceforge.net