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

DisjunctionSumScorer.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 DISJUNCTIONSUMSCORER_H
8 #define DISJUNCTIONSUMSCORER_H
9
10 #include "Scorer.h"
11
12 namespace Lucene {
13
16 class DisjunctionSumScorer : public Scorer {
17 public:
18 DisjunctionSumScorer(Collection<ScorerPtr> subScorers, int32_t minimumNrMatchers = 1);
19 virtual ~DisjunctionSumScorer();
20
21 LUCENE_CLASS(DisjunctionSumScorer);
22
23 protected:
25 int32_t nrScorers;
26
28 Collection<ScorerPtr> subScorers;
29
31 int32_t minimumNrMatchers;
32
40 ScorerDocQueuePtr scorerDocQueue;
41
43 int32_t currentDoc;
44
46 int32_t _nrMatchers;
47
48 double currentScore;
49
50 public:
51 virtual void initialize();
52
53 virtual void score(const CollectorPtr& collector);
54 virtual int32_t nextDoc();
55
58 virtual double score();
59
60 virtual int32_t docID();
61
64 int32_t nrMatchers();
65
71 virtual int32_t advance(int32_t target);
72
73 protected:
75 void initScorerDocQueue();
76
82 virtual bool score(const CollectorPtr& collector, int32_t max, int32_t firstDocID);
83
90 bool advanceAfterCurrent();
91 };
92
93 }
94
95 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Scorer.h
Lucene::Collection< ScorerPtr >
Lucene::DisjunctionSumScorer
A Scorer for OR like queries, counterpart of ConjunctionScorer. This Scorer implements {} and uses sk...
Definition: DisjunctionSumScorer.h:16
Lucene::DisjunctionSumScorer::DisjunctionSumScorer
DisjunctionSumScorer(Collection< ScorerPtr > subScorers, int32_t minimumNrMatchers=1)
Lucene::DisjunctionSumScorer::scorerDocQueue
ScorerDocQueuePtr scorerDocQueue
The scorerDocQueue contains all subscorers ordered by their current doc(), with the minimum at the to...
Definition: DisjunctionSumScorer.h:40
Lucene::DisjunctionSumScorer::minimumNrMatchers
int32_t minimumNrMatchers
The minimum number of scorers that should match.
Definition: DisjunctionSumScorer.h:31
Lucene::DisjunctionSumScorer::currentScore
double currentScore
Definition: DisjunctionSumScorer.h:48
Lucene::DisjunctionSumScorer::currentDoc
int32_t currentDoc
The document number of the current match.
Definition: DisjunctionSumScorer.h:43
Lucene::DisjunctionSumScorer::_nrMatchers
int32_t _nrMatchers
The number of subscorers that provide the current match.
Definition: DisjunctionSumScorer.h:46
Lucene::DisjunctionSumScorer::score
virtual double score()
Returns the score of the current document matching the query. Initially invalid, until next() is call...
Lucene::DisjunctionSumScorer::score
virtual void score(const CollectorPtr &collector)
Scores and collects all matching documents.
Lucene::DisjunctionSumScorer::~DisjunctionSumScorer
virtual ~DisjunctionSumScorer()
Lucene::DisjunctionSumScorer::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::DisjunctionSumScorer::advance
virtual int32_t advance(int32_t target)
Advances to the first match beyond the current whose document number is greater than or equal to a gi...
Lucene::DisjunctionSumScorer::subScorers
Collection< ScorerPtr > subScorers
The subscorers.
Definition: DisjunctionSumScorer.h:28
Lucene::DisjunctionSumScorer::nrMatchers
int32_t nrMatchers()
Returns the number of subscorers matching the current document. Initially invalid,...
Lucene::DisjunctionSumScorer::score
virtual bool score(const CollectorPtr &collector, int32_t max, int32_t firstDocID)
Collects matching documents in a range. Hook for optimization. Note that next() must be called once b...
Lucene::DisjunctionSumScorer::initScorerDocQueue
void initScorerDocQueue()
Called the first time next() or skipTo() is called to initialize scorerDocQueue.
Lucene::DisjunctionSumScorer::nrScorers
int32_t nrScorers
The number of subscorers.
Definition: DisjunctionSumScorer.h:21
Lucene::DisjunctionSumScorer::initialize
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
Lucene::DisjunctionSumScorer::advanceAfterCurrent
bool advanceAfterCurrent()
Advance all subscorers after the current document determined by the top of the scorerDocQueue....
Lucene::DisjunctionSumScorer::docID
virtual int32_t docID()
Returns the following:
Lucene::Scorer
Common scoring functionality for different types of queries.
Definition: Scorer.h:33
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::ScorerDocQueuePtr
boost::shared_ptr< ScorerDocQueue > ScorerDocQueuePtr
Definition: LuceneTypes.h:549
Lucene::CollectorPtr
boost::shared_ptr< Collector > CollectorPtr
Definition: LuceneTypes.h:295

clucene.sourceforge.net