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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

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

clucene.sourceforge.net