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 // 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 PHRASESCORER_H
8 #define PHRASESCORER_H
9 
10 #include "Scorer.h"
11 
12 namespace Lucene
13 {
21  class PhraseScorer : public Scorer
22  {
23  public:
25  virtual ~PhraseScorer();
26 
28 
29  protected:
31  ByteArray norms;
32  double value;
33 
34  bool firstTime;
35  bool more;
39 
40  double freq; // phrase frequency in current doc as computed by phraseFreq().
41 
42  public:
43  virtual int32_t docID();
44  virtual int32_t nextDoc();
45  virtual double score();
46  virtual int32_t advance(int32_t target);
47 
49  double currentFreq();
50 
51  virtual String toString();
52 
53  protected:
55  bool doNext();
56 
62  virtual double phraseFreq() = 0;
63 
64  void init();
65  void sort();
66  void pqToList();
67  void firstToLast();
68  };
69 }
70 
71 #endif

clucene.sourceforge.net