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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PhraseQuery.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 PHRASEQUERY_H
8 #define PHRASEQUERY_H
9 
10 #include "Query.h"
11 
12 namespace Lucene {
13 
18 class LPPAPI PhraseQuery : public Query {
19 public:
21  PhraseQuery();
22  virtual ~PhraseQuery();
23 
25 
26 protected:
27  String field;
30  int32_t maxPosition;
31  int32_t slop;
32 
33 public:
34  using Query::toString;
35 
46  void setSlop(int32_t slop);
47 
50  int32_t getSlop();
51 
54  void add(const TermPtr& term);
55 
59  void add(const TermPtr& term, int32_t position);
60 
62  Collection<TermPtr> getTerms();
63 
65  Collection<int32_t> getPositions();
66 
67  virtual WeightPtr createWeight(const SearcherPtr& searcher);
68  virtual void extractTerms(SetTerm terms);
69 
71  virtual String toString(const String& field);
72 
73  virtual bool equals(const LuceneObjectPtr& other);
74  virtual int32_t hashCode();
75  virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
76 
77  friend class PhraseWeight;
78 };
79 
80 }
81 
82 #endif

clucene.sourceforge.net