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
20 LUCENE_CLASS(SpanWeight);
21
22 protected:
23 SimilarityPtr similarity;
24 double value;
25 double idf;
26 double queryNorm;
27 double queryWeight;
28
29 SetTerm terms;
30 SpanQueryPtr query;
31 IDFExplanationPtr idfExp;
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
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Weight.h
Lucene::PayloadNearSpanScorer
Definition: PayloadNearQuery.h:63
Lucene::SpanWeight
Public for use by other weight implementations.
Definition: SpanWeight.h:15
Lucene::SpanWeight::sumOfSquaredWeights
virtual double sumOfSquaredWeights()
The sum of squared weights of contained query clauses.
Lucene::SpanWeight::idfExp
IDFExplanationPtr idfExp
Definition: SpanWeight.h:31
Lucene::SpanWeight::queryWeight
double queryWeight
Definition: SpanWeight.h:27
Lucene::SpanWeight::queryNorm
double queryNorm
Definition: SpanWeight.h:26
Lucene::SpanWeight::explain
virtual ExplanationPtr explain(const IndexReaderPtr &reader, int32_t doc)
An explanation of the score computation for the named document.
Lucene::SpanWeight::scorer
virtual ScorerPtr scorer(const IndexReaderPtr &reader, bool scoreDocsInOrder, bool topScorer)
Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder.
Lucene::SpanWeight::query
SpanQueryPtr query
Definition: SpanWeight.h:30
Lucene::SpanWeight::value
double value
Definition: SpanWeight.h:24
Lucene::SpanWeight::getQuery
virtual QueryPtr getQuery()
The query that this concerns.
Lucene::SpanWeight::getValue
virtual double getValue()
The weight for this query.
Lucene::SpanWeight::~SpanWeight
virtual ~SpanWeight()
Lucene::SpanWeight::similarity
SimilarityPtr similarity
Definition: SpanWeight.h:20
Lucene::SpanWeight::terms
SetTerm terms
Definition: SpanWeight.h:29
Lucene::SpanWeight::normalize
virtual void normalize(double norm)
Assigns the query normalization factor to this.
Lucene::SpanWeight::SpanWeight
SpanWeight(const SpanQueryPtr &query, const SearcherPtr &searcher)
Lucene::SpanWeight::idf
double idf
Definition: SpanWeight.h:25
Lucene::Weight
Calculate query weights and build query scorers.
Definition: Weight.h:30
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::SpanQueryPtr
boost::shared_ptr< SpanQuery > SpanQueryPtr
Definition: LuceneTypes.h:450
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
Lucene::IDFExplanationPtr
boost::shared_ptr< IDFExplanation > IDFExplanationPtr
Definition: LuceneTypes.h:372
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::ScorerPtr
boost::shared_ptr< Scorer > ScorerPtr
Definition: LuceneTypes.h:429

clucene.sourceforge.net