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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PhraseScorer.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 PHRASESCORER_H
8 #define PHRASESCORER_H
9 
10 #include "Scorer.h"
11 
12 namespace Lucene {
13 
21 class PhraseScorer : public Scorer {
22 public:
24  virtual ~PhraseScorer();
25 
27 
28 protected:
30  ByteArray norms;
31  double value;
32 
33  bool firstTime;
34  bool more;
38 
39  double freq; // phrase frequency in current doc as computed by phraseFreq().
40 
41 public:
42  virtual int32_t docID();
43  virtual int32_t nextDoc();
44  virtual double score();
45  virtual int32_t advance(int32_t target);
46 
48  double currentFreq();
49 
50  virtual String toString();
51 
52 protected:
54  bool doNext();
55 
61  virtual double phraseFreq() = 0;
62 
63  void init();
64  void sort();
65  void pqToList();
66  void firstToLast();
67 };
68 
69 }
70 
71 #endif

clucene.sourceforge.net