public class

ConstantScoreQuery

extends Query
java.lang.Object
   ↳ org.apache.lucene.search.Query
     ↳ org.apache.lucene.search.ConstantScoreQuery

Class Overview

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.

Summary

Nested Classes
class ConstantScoreQuery.ConstantScorer  
class ConstantScoreQuery.ConstantWeight  
Fields
protected final Filter filter
Public Constructors
ConstantScoreQuery(Filter filter)
Public Methods
Weight createWeight(Searcher searcher)
Expert: Constructs an appropriate Weight implementation for this query.
boolean equals(Object o)
Returns true if o is equal to this.
void extractTerms(Set<Term> terms)
Expert: adds all terms occurring in this query to the terms set.
Filter getFilter()
Returns the encapsulated filter
int hashCode()
Returns a hash code value for this object.
Query rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
String toString(String field)
Prints a user-readable version of this query.
[Expand]
Inherited Methods
From class org.apache.lucene.search.Query
From class java.lang.Object

Fields

protected final Filter filter

Public Constructors

public ConstantScoreQuery (Filter filter)

Public Methods

public Weight createWeight (Searcher searcher)

Expert: Constructs an appropriate Weight implementation for this query.

Only implemented by primitive queries, which re-write to themselves.

public boolean equals (Object o)

Returns true if o is equal to this.

public void extractTerms (Set<Term> terms)

Expert: adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten form.

public Filter getFilter ()

Returns the encapsulated filter

public int hashCode ()

Returns a hash code value for this object.

public Query rewrite (IndexReader reader)

Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

Throws
IOException

public String toString (String field)

Prints a user-readable version of this query.