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

Loading...
Searching...
No Matches
DisjunctionMaxScorer.h
Go to the documentation of this file.
1
2// 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 DISJUNCTIONMAXSCORER_H
8#define DISJUNCTIONMAXSCORER_H
9
10#include "Scorer.h"
11
12 namespace Lucene {
13
18 class DisjunctionMaxScorer : public Scorer {
19 public:
20 DisjunctionMaxScorer(double tieBreakerMultiplier, const SimilarityPtr& similarity, Collection<ScorerPtr> subScorers, int32_t numScorers);
21 virtual ~DisjunctionMaxScorer();
22
23 LUCENE_CLASS(DisjunctionMaxScorer);
24
25 protected:
27 Collection<ScorerPtr> subScorers;
28 int32_t numScorers;
29
31 double tieBreakerMultiplier;
32
33 int32_t doc;
34
35 public:
36 virtual int32_t nextDoc();
37 virtual int32_t docID();
38
41 virtual double score();
42
43 virtual int32_t advance(int32_t target);
44
45 protected:
47 void scoreAll(int32_t root, int32_t size, int32_t doc, Collection<double> sum, Collection<double> max);
48
50 void heapify();
51
54 void heapAdjust(int32_t root);
55
57 void heapRemoveRoot();
58};
59
60}
61
62#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Scorer.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::DisjunctionMaxScorer
The Scorer for DisjunctionMaxQuery. The union of all documents generated by the the subquery scorers ...
Definition DisjunctionMaxScorer.h:18
Lucene::DisjunctionMaxScorer::tieBreakerMultiplier
double tieBreakerMultiplier
Multiplier applied to non-maximum-scoring subqueries for a document as they are summed into the resul...
Definition DisjunctionMaxScorer.h:31
Lucene::DisjunctionMaxScorer::scoreAll
void scoreAll(int32_t root, int32_t size, int32_t doc, Collection< double > sum, Collection< double > max)
Recursively iterate all subScorers that generated last doc computing sum and max.
Lucene::DisjunctionMaxScorer::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::DisjunctionMaxScorer::numScorers
int32_t numScorers
Definition DisjunctionMaxScorer.h:28
Lucene::DisjunctionMaxScorer::score
virtual double score()
Determine the current document score. Initially invalid, until next() is called the first time.
Lucene::DisjunctionMaxScorer::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::DisjunctionMaxScorer::~DisjunctionMaxScorer
virtual ~DisjunctionMaxScorer()
Lucene::DisjunctionMaxScorer::docID
virtual int32_t docID()
Returns the following:
Lucene::DisjunctionMaxScorer::subScorers
Collection< ScorerPtr > subScorers
The scorers for subqueries that have remaining docs, kept as a min heap by number of next doc.
Definition DisjunctionMaxScorer.h:27
Lucene::DisjunctionMaxScorer::heapRemoveRoot
void heapRemoveRoot()
Remove the root Scorer from subScorers and re-establish it as a heap.
Lucene::DisjunctionMaxScorer::DisjunctionMaxScorer
DisjunctionMaxScorer(double tieBreakerMultiplier, const SimilarityPtr &similarity, Collection< ScorerPtr > subScorers, int32_t numScorers)
Lucene::DisjunctionMaxScorer::doc
int32_t doc
Definition DisjunctionMaxScorer.h:33
Lucene::DisjunctionMaxScorer::heapify
void heapify()
Organize subScorers into a min heap with scorers generating the earliest document on top.
Lucene::DisjunctionMaxScorer::heapAdjust
void heapAdjust(int32_t root)
The subtree of subScorers at root is a min heap except possibly for its root element....
Lucene::Scorer
Common scoring functionality for different types of queries.
Definition Scorer.h:33
Lucene::Scorer::similarity
SimilarityPtr similarity
Definition Scorer.h:45
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::SimilarityPtr
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435

clucene.sourceforge.net