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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MultiPhraseQuery.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 MULTIPHRASEQUERY_H
8 #define MULTIPHRASEQUERY_H
9 
10 #include "Query.h"
11 
12 namespace Lucene {
13 
18 class LPPAPI MultiPhraseQuery : public Query {
19 public:
21  virtual ~MultiPhraseQuery();
22 
24 
25 protected:
26  String field;
29  int32_t slop;
30 
31 public:
32  using Query::toString;
33 
36  void setSlop(int32_t s);
37 
40  int32_t getSlop();
41 
44  void add(const TermPtr& term);
45 
48  void add(Collection<TermPtr> terms);
49 
52  void add(Collection<TermPtr> terms, int32_t position);
53 
55  Collection< Collection<TermPtr> > getTermArrays();
56 
58  Collection<int32_t> getPositions();
59 
60  virtual void extractTerms(SetTerm terms);
61  virtual QueryPtr rewrite(const IndexReaderPtr& reader);
62  virtual WeightPtr createWeight(const SearcherPtr& searcher);
63 
65  virtual String toString(const String& field);
66 
67  virtual bool equals(const LuceneObjectPtr& other);
68  virtual int32_t hashCode();
69  virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
70 
71 protected:
72  int32_t termArraysHashCode();
73  bool termArraysEquals(Collection< Collection<TermPtr> > first, Collection< Collection<TermPtr> > second);
74 
75  friend class MultiPhraseWeight;
76 };
77 
78 }
79 
80 #endif

clucene.sourceforge.net