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
12namespace Lucene {
13
19public:
22
24
25protected:
28 int32_t numScorers;
29
32
33 int32_t doc;
34
35public:
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
45protected:
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
58};
59
60}
61
62#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
The Scorer for DisjunctionMaxQuery. The union of all documents generated by the the subquery scorers ...
Definition DisjunctionMaxScorer.h:18
double tieBreakerMultiplier
Multiplier applied to non-maximum-scoring subqueries for a document as they are summed into the resul...
Definition DisjunctionMaxScorer.h:31
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.
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...
int32_t numScorers
Definition DisjunctionMaxScorer.h:28
virtual double score()
Determine the current document score. Initially invalid, until next() is called the first time.
virtual int32_t advance(int32_t target)
Advances to the first beyond the current whose document number is greater than or equal to target....
virtual int32_t docID()
Returns the following:
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
void heapRemoveRoot()
Remove the root Scorer from subScorers and re-establish it as a heap.
DisjunctionMaxScorer(double tieBreakerMultiplier, const SimilarityPtr &similarity, Collection< ScorerPtr > subScorers, int32_t numScorers)
int32_t doc
Definition DisjunctionMaxScorer.h:33
void heapify()
Organize subScorers into a min heap with scorers generating the earliest document on top.
void heapAdjust(int32_t root)
The subtree of subScorers at root is a min heap except possibly for its root element....
Common scoring functionality for different types of queries.
Definition Scorer.h:33
SimilarityPtr similarity
Definition Scorer.h:45
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< Similarity > SimilarityPtr
Definition LuceneTypes.h:435

clucene.sourceforge.net