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
MultiPhraseQuery.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 MULTIPHRASEQUERY_H
8 #define MULTIPHRASEQUERY_H
9
10 #include "Query.h"
11
12 namespace Lucene
13 {
18 class LPPAPI MultiPhraseQuery : public Query
19 {
20 public:
21 MultiPhraseQuery();
22 virtual ~MultiPhraseQuery();
23
24 LUCENE_CLASS(MultiPhraseQuery);
25
26 protected:
27 String field;
28 Collection< Collection<TermPtr> > termArrays;
29 Collection<int32_t> positions;
30 int32_t slop;
31
32 public:
33 using Query::toString;
34
37 void setSlop(int32_t s);
38
41 int32_t getSlop();
42
45 void add(TermPtr term);
46
49 void add(Collection<TermPtr> terms);
50
53 void add(Collection<TermPtr> terms, int32_t position);
54
56 Collection< Collection<TermPtr> > getTermArrays();
57
59 Collection<int32_t> getPositions();
60
61 virtual void extractTerms(SetTerm terms);
62 virtual QueryPtr rewrite(IndexReaderPtr reader);
63 virtual WeightPtr createWeight(SearcherPtr searcher);
64
66 virtual String toString(const String& field);
67
68 virtual bool equals(LuceneObjectPtr other);
69 virtual int32_t hashCode();
70 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
71
72 protected:
73 int32_t termArraysHashCode();
74 bool termArraysEquals(Collection< Collection<TermPtr> > first, Collection< Collection<TermPtr> > second);
75
76 friend class MultiPhraseWeight;
77 };
78 }
79
80 #endif

clucene.sourceforge.net