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

FilteredQuery.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 FILTEREDQUERY_H
8 #define FILTEREDQUERY_H
9
10 #include "Query.h"
11
12 namespace Lucene {
13
20 class LPPAPI FilteredQuery : public Query {
21 public:
26 FilteredQuery(const QueryPtr& query, const FilterPtr& filter);
27
28 virtual ~FilteredQuery();
29
30 LUCENE_CLASS(FilteredQuery);
31
32 private:
33 QueryPtr query;
34 FilterPtr filter;
35
36 public:
37 using Query::toString;
38
41 virtual WeightPtr createWeight(const SearcherPtr& searcher);
42
44 virtual QueryPtr rewrite(const IndexReaderPtr& reader);
45
46 QueryPtr getQuery();
47 FilterPtr getFilter();
48
49 virtual void extractTerms(SetTerm terms);
50
52 virtual String toString(const String& field);
53
54 virtual bool equals(const LuceneObjectPtr& other);
55 virtual int32_t hashCode();
56 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
57
58 friend class FilteredQueryWeight;
59 };
60
61 }
62
63 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Query.h
Lucene::FilteredQuery
A query that applies a filter to the results of another query.
Definition: FilteredQuery.h:20
Lucene::FilteredQuery::toString
virtual String toString(const String &field)
Prints a user-readable version of this query.
Lucene::FilteredQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::FilteredQuery::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::FilteredQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::FilteredQuery::getFilter
FilterPtr getFilter()
Lucene::FilteredQuery::getQuery
QueryPtr getQuery()
Lucene::FilteredQuery::~FilteredQuery
virtual ~FilteredQuery()
Lucene::FilteredQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::FilteredQuery::createWeight
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Returns a Weight that applies the filter to the enclosed query's Weight. This is accomplished by over...
Lucene::FilteredQuery::FilteredQuery
FilteredQuery(const QueryPtr &query, const FilterPtr &filter)
Constructs a new query which applies a filter to the results of the original query....
Lucene::FilteredQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Rewrites the wrapped query.
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
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::FilterPtr
boost::shared_ptr< Filter > FilterPtr
Definition: LuceneTypes.h:358
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480

clucene.sourceforge.net