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


ConstantScoreQuery.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 CONSTANTSCOREQUERY_H
8 #define CONSTANTSCOREQUERY_H
9 
10 #include "Query.h"
11 #include "Weight.h"
12 #include "Scorer.h"
13 
14 namespace Lucene {
15 
18 class LPPAPI ConstantScoreQuery : public Query {
19 public:
20  ConstantScoreQuery(const FilterPtr& filter);
22 
24 
25 protected:
27 
28 public:
29  using Query::toString;
30 
33 
34  virtual QueryPtr rewrite(const IndexReaderPtr& reader);
35  virtual void extractTerms(SetTerm terms);
36 
37  virtual WeightPtr createWeight(const SearcherPtr& searcher);
38 
40  virtual String toString(const String& field);
41 
42  virtual bool equals(const LuceneObjectPtr& other);
43  virtual int32_t hashCode();
45 
46  friend class ConstantWeight;
47  friend class ConstantScorer;
48 };
49 
50 }
51 
52 #endif
Scorer.h
Lucene::ConstantScoreQuery::~ConstantScoreQuery
virtual ~ConstantScoreQuery()
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::FilterPtr
boost::shared_ptr< Filter > FilterPtr
Definition: LuceneTypes.h:358
Lucene::ConstantScoreQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::ConstantScoreQuery::ConstantScoreQuery
ConstantScoreQuery(const FilterPtr &filter)
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
Query.h
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::ConstantScoreQuery::toString
virtual String toString(const String &field)
Prints a user-readable version of this query.
Lucene::Query
The abstract base class for queries.
Definition: Query.h:31
Lucene::ConstantScoreQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::ConstantScoreQuery::getFilter
FilterPtr getFilter()
Returns the encapsulated filter.
Lucene::ConstantScoreQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
Lucene::ConstantScoreQuery::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::ConstantScoreQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::ConstantScoreQuery::createWeight
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
Lucene::ConstantScoreQuery
A query that wraps a filter and simply returns a constant score equal to the query boost for every do...
Definition: ConstantScoreQuery.h:18
Weight.h
Lucene::Query::toString
virtual String toString()
Prints a query to a string.
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
Lucene::ConstantScoreQuery::filter
FilterPtr filter
Definition: ConstantScoreQuery.h:23

clucene.sourceforge.net