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

Loading...
Searching...
No Matches
TopFieldCollector.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 TOPFIELDCOLLECTOR_H
8#define TOPFIELDCOLLECTOR_H
9
10#include "TopDocsCollector.h"
11
12 namespace Lucene {
13
17 class LPPAPI TopFieldCollector : public TopDocsCollector {
18 public:
19 TopFieldCollector(const HitQueueBasePtr& pq, int32_t numHits, bool fillFields);
20 virtual ~TopFieldCollector();
21
22 LUCENE_CLASS(TopFieldCollector);
23
24 protected:
25 bool fillFields;
26
29 double maxScore;
30
31 int32_t numHits;
32 FieldValueHitQueueEntryPtr bottom;
33 bool queueFull;
34 int32_t docBase;
35
36 public:
55 static TopFieldCollectorPtr create(const SortPtr& sort, int32_t numHits, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder);
56
57 virtual void add(int32_t slot, int32_t doc, double score);
58
59 virtual bool acceptsDocsOutOfOrder();
60
61 protected:
62 static const Collection<ScoreDocPtr> EMPTY_SCOREDOCS();
63
66 virtual void populateResults(Collection<ScoreDocPtr> results, int32_t howMany);
67
68 virtual TopDocsPtr newTopDocs(Collection<ScoreDocPtr> results, int32_t start);
69};
70
71}
72
73#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
TopDocsCollector.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::TopDocsCollector
A base class for all collectors that return a TopDocs output. This collector allows easy extension by...
Definition TopDocsCollector.h:21
Lucene::TopFieldCollector
A Collector that sorts by SortField using FieldComparators.
Definition TopFieldCollector.h:17
Lucene::TopFieldCollector::newTopDocs
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...
Lucene::TopFieldCollector::TopFieldCollector
TopFieldCollector(const HitQueueBasePtr &pq, int32_t numHits, bool fillFields)
Lucene::TopFieldCollector::acceptsDocsOutOfOrder
virtual bool acceptsDocsOutOfOrder()
Return true if this collector does not require the matching docIDs to be delivered in int sort order ...
Lucene::TopFieldCollector::docBase
int32_t docBase
Definition TopFieldCollector.h:34
Lucene::TopFieldCollector::queueFull
bool queueFull
Definition TopFieldCollector.h:33
Lucene::TopFieldCollector::add
virtual void add(int32_t slot, int32_t doc, double score)
Lucene::TopFieldCollector::maxScore
double maxScore
Stores the maximum score value encountered, needed for normalizing. If document scores are not tracke...
Definition TopFieldCollector.h:29
Lucene::TopFieldCollector::EMPTY_SCOREDOCS
static const Collection< ScoreDocPtr > EMPTY_SCOREDOCS()
Lucene::TopFieldCollector::populateResults
virtual void populateResults(Collection< ScoreDocPtr > results, int32_t howMany)
Only the following callback methods need to be overridden since topDocs(int32_t, int32_t) calls them ...
Lucene::TopFieldCollector::bottom
FieldValueHitQueueEntryPtr bottom
Definition TopFieldCollector.h:32
Lucene::TopFieldCollector::~TopFieldCollector
virtual ~TopFieldCollector()
Lucene::TopFieldCollector::numHits
int32_t numHits
Definition TopFieldCollector.h:31
Lucene::TopFieldCollector::fillFields
bool fillFields
Definition TopFieldCollector.h:25
Lucene::TopFieldCollector::create
static TopFieldCollectorPtr create(const SortPtr &sort, int32_t numHits, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder)
Creates a new TopFieldCollector from the given arguments.
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::TopDocsPtr
boost::shared_ptr< TopDocs > TopDocsPtr
Definition LuceneTypes.h:471
Lucene::HitQueueBasePtr
boost::shared_ptr< HitQueueBase > HitQueueBasePtr
Definition LuceneTypes.h:371
Lucene::TopFieldCollectorPtr
boost::shared_ptr< TopFieldCollector > TopFieldCollectorPtr
Definition LuceneTypes.h:473
Lucene::SortPtr
boost::shared_ptr< Sort > SortPtr
Definition LuceneTypes.h:442
Lucene::FieldValueHitQueueEntryPtr
boost::shared_ptr< FieldValueHitQueueEntry > FieldValueHitQueueEntryPtr
Definition LuceneTypes.h:357

clucene.sourceforge.net