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
23 LUCENE_CLASS(TermQuery);
24
25 protected:
26 TermPtr term;
27
28 public:
29 using Query::toString;
30
32 TermPtr getTerm();
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();
42 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
43
44 friend class TermWeight;
45 };
46
47 }
48
49 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Query.h
Lucene::Query
The abstract base class for queries.
Definition: Query.h:31
Lucene::Query::toString
virtual String toString()
Prints a query to a string.
Lucene::TermQuery
A Query that matches documents containing a term. This may be combined with other terms with a Boolea...
Definition: TermQuery.h:16
Lucene::TermQuery::createWeight
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
Lucene::TermQuery::~TermQuery
virtual ~TermQuery()
Lucene::TermQuery::extractTerms
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...
Lucene::TermQuery::TermQuery
TermQuery(const TermPtr &term)
Constructs a query for the term.
Lucene::TermQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::TermQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::TermQuery::toString
virtual String toString(const String &field)
Prints a user-readable version of this query.
Lucene::TermQuery::getTerm
TermPtr getTerm()
Returns the term of this query.
Lucene::TermQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::TermQuery::term
TermPtr term
Definition: TermQuery.h:23
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480

clucene.sourceforge.net