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


TopScoreDocCollector.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 TOPSCOREDOCCOLLECTOR_H
8#define TOPSCOREDOCCOLLECTOR_H
9
10#include "TopDocsCollector.h"
11
12namespace Lucene {
13
22public:
23 TopScoreDocCollector(int32_t numHits);
25
27
28INTERNAL:
29 ScoreDocPtr pqTop;
30 int32_t docBase;
32
33public:
38 static TopScoreDocCollectorPtr create(int32_t numHits, bool docsScoredInOrder);
39
40 virtual void setNextReader(const IndexReaderPtr& reader, int32_t docBase);
41 virtual void setScorer(const ScorerPtr& scorer);
42
43protected:
44 virtual TopDocsPtr newTopDocs(Collection<ScoreDocPtr> results, int32_t start);
45};
46
47}
48
49#endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
A base class for all collectors that return a TopDocs output. This collector allows easy extension by...
Definition: TopDocsCollector.h:21
A Collector implementation that collects the top-scoring hits, returning them as a TopDocs....
Definition: TopScoreDocCollector.h:21
virtual void setNextReader(const IndexReaderPtr &reader, int32_t docBase)
Called before collecting from each IndexReader. All doc ids in collect(int32_t) will correspond to re...
TopScoreDocCollector(int32_t numHits)
ScorerWeakPtr _scorer
Definition: TopScoreDocCollector.h:31
virtual void setScorer(const ScorerPtr &scorer)
Called before successive calls to collect(int32_t). Implementations that need the score of the curren...
int32_t docBase
Definition: TopScoreDocCollector.h:30
static TopScoreDocCollectorPtr create(int32_t numHits, bool docsScoredInOrder)
Creates a new TopScoreDocCollector given the number of hits to collect and whether documents are scor...
virtual TopDocsPtr newTopDocs(Collection< ScoreDocPtr > results, int32_t start)
Returns a TopDocs instance containing the given results. If results is null it means there are no res...
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< TopDocs > TopDocsPtr
Definition: LuceneTypes.h:471
boost::shared_ptr< TopScoreDocCollector > TopScoreDocCollectorPtr
Definition: LuceneTypes.h:475
boost::shared_ptr< ScoreDoc > ScoreDocPtr
Definition: LuceneTypes.h:428
boost::weak_ptr< Scorer > ScorerWeakPtr
Definition: LuceneTypes.h:429
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
boost::shared_ptr< Scorer > ScorerPtr
Definition: LuceneTypes.h:429

clucene.sourceforge.net