org.apache.lucene.search

Class ConstantScoreQuery

Implemented Interfaces:
Cloneable, Serializable

public class ConstantScoreQuery
extends Query

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.
Version:
$Id$
Author:
yonik
See Also:
Serialized Form

Nested Class Summary

protected class
ConstantScoreQuery.ConstantScorer
protected class
ConstantScoreQuery.ConstantWeight

Field Summary

protected Filter
filter

Constructor Summary

ConstantScoreQuery(Filter filter)

Method Summary

protected Weight
createWeight(Searcher searcher)
boolean
equals(Object o)
Returns true if o is equal to this.
int
hashCode()
Returns a hash code value for this object.
Query
rewrite(IndexReader reader)
String
toString(String field)
Prints a user-readable version of this query.

Methods inherited from class org.apache.lucene.search.Query

clone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, toString, weight

Field Details

filter

protected final Filter filter

Constructor Details

ConstantScoreQuery

public ConstantScoreQuery(Filter filter)

Method Details

createWeight

protected Weight createWeight(Searcher searcher)
Overrides:
createWeight in interface Query

equals

public boolean equals(Object o)
Returns true if o is equal to this.

hashCode

public int hashCode()
Returns a hash code value for this object.

rewrite

public Query rewrite(IndexReader reader)
            throws IOException
Overrides:
rewrite in interface Query

toString

public String toString(String field)
Prints a user-readable version of this query.
Overrides:
toString in interface Query

Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.