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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TopFieldCollector.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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  {
19  public:
20  TopFieldCollector(HitQueueBasePtr pq, int32_t numHits, bool fillFields);
21  virtual ~TopFieldCollector();
22 
24 
25  protected:
26  bool fillFields;
27 
30  double maxScore;
31 
32  int32_t numHits;
34  bool queueFull;
35  int32_t docBase;
36 
37  public:
56  static TopFieldCollectorPtr create(SortPtr sort, int32_t numHits, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder);
57 
58  virtual void add(int32_t slot, int32_t doc, double score);
59 
60  virtual bool acceptsDocsOutOfOrder();
61 
62  protected:
63  static const Collection<ScoreDocPtr> EMPTY_SCOREDOCS();
64 
67  virtual void populateResults(Collection<ScoreDocPtr> results, int32_t howMany);
68 
69  virtual TopDocsPtr newTopDocs(Collection<ScoreDocPtr> results, int32_t start);
70  };
71 }
72 
73 #endif

clucene.sourceforge.net