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

SpanScorer.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 SPANSCORER_H
8 #define SPANSCORER_H
9
10 #include "Scorer.h"
11
12 namespace Lucene {
13
15 class LPPAPI SpanScorer : public Scorer {
16 public:
17 SpanScorer(const SpansPtr& spans, const WeightPtr& weight, const SimilarityPtr& similarity, ByteArray norms);
18 virtual ~SpanScorer();
19
20 LUCENE_CLASS(SpanScorer);
21
22 protected:
23 SpansPtr spans;
24 WeightPtr weight;
25 ByteArray norms;
26 double value;
27 bool more;
28 int32_t doc;
29 double freq;
30
31 public:
32 virtual int32_t nextDoc();
33 virtual int32_t advance(int32_t target);
34 virtual int32_t docID();
35 virtual double score();
36 virtual float termFreq(){
37 return freq;
38 }
39
40 protected:
41 virtual bool setFreqCurrentDoc();
42
45 virtual ExplanationPtr explain(int32_t doc);
46
47 friend class SpanWeight;
48 friend class PayloadNearSpanWeight;
49 };
50
51 }
52
53 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Scorer.h
Lucene::PayloadNearSpanWeight
Definition: PayloadNearQuery.h:52
Lucene::Scorer
Common scoring functionality for different types of queries.
Definition: Scorer.h:33
Lucene::SpanScorer
Public for extension only.
Definition: SpanScorer.h:15
Lucene::SpanScorer::spans
SpansPtr spans
Definition: SpanScorer.h:20
Lucene::SpanScorer::more
bool more
Definition: SpanScorer.h:27
Lucene::SpanScorer::advance
virtual int32_t advance(int32_t target)
Advances to the first beyond the current whose document number is greater than or equal to target....
Lucene::SpanScorer::docID
virtual int32_t docID()
Returns the following:
Lucene::SpanScorer::termFreq
virtual float termFreq()
Definition: SpanScorer.h:36
Lucene::SpanScorer::~SpanScorer
virtual ~SpanScorer()
Lucene::SpanScorer::norms
ByteArray norms
Definition: SpanScorer.h:25
Lucene::SpanScorer::weight
WeightPtr weight
Definition: SpanScorer.h:24
Lucene::SpanScorer::score
virtual double score()
Returns the score of the current document matching the query. Initially invalid, until {} or #advanc...
Lucene::SpanScorer::explain
virtual ExplanationPtr explain(int32_t doc)
This method is no longer an official member of Scorer, but it is needed by SpanWeight to build an exp...
Lucene::SpanScorer::SpanScorer
SpanScorer(const SpansPtr &spans, const WeightPtr &weight, const SimilarityPtr &similarity, ByteArray norms)
Lucene::SpanScorer::value
double value
Definition: SpanScorer.h:26
Lucene::SpanScorer::setFreqCurrentDoc
virtual bool setFreqCurrentDoc()
Lucene::SpanScorer::nextDoc
virtual int32_t nextDoc()
Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS if t...
Lucene::SpanScorer::freq
double freq
Definition: SpanScorer.h:29
Lucene::SpanScorer::doc
int32_t doc
Definition: SpanScorer.h:28
Lucene::SpanWeight
Public for use by other weight implementations.
Definition: SpanWeight.h:15
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
Lucene::SpansPtr
boost::shared_ptr< Spans > SpansPtr
Definition: LuceneTypes.h:453
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480

clucene.sourceforge.net