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


TermQuery.h
Go to the documentation of this file.
1 // 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 TERMQUERY_H
8 #define TERMQUERY_H
9 
10 #include "Query.h"
11 
12 namespace Lucene {
13 
16 class LPPAPI TermQuery : public Query {
17 public:
19  TermQuery(const TermPtr& term);
20 
21  virtual ~TermQuery();
22 
24 
25 protected:
27 
28 public:
29  using Query::toString;
30 
33 
34  virtual WeightPtr createWeight(const SearcherPtr& searcher);
35  virtual void extractTerms(SetTerm terms);
36 
38  virtual String toString(const String& field);
39 
40  virtual bool equals(const LuceneObjectPtr& other);
41  virtual int32_t hashCode();
43 
44  friend class TermWeight;
45 };
46 
47 }
48 
49 #endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
The abstract base class for queries.
Definition: Query.h:31
virtual String toString()
Prints a query to a string.
A Query that matches documents containing a term. This may be combined with other terms with a Boolea...
Definition: TermQuery.h:16
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
virtual ~TermQuery()
virtual void extractTerms(SetTerm terms)
Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten...
TermQuery(const TermPtr &term)
Constructs a query for the term.
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
virtual int32_t hashCode()
Return hash code for this object.
virtual String toString(const String &field)
Prints a user-readable version of this query.
TermPtr getTerm()
Returns the term of this query.
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
TermPtr term
Definition: TermQuery.h:23
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480

clucene.sourceforge.net