public class ConstantScoreQuery extends Query
Modifier and Type | Class and Description |
---|---|
protected class |
ConstantScoreQuery.ConstantScorer |
protected class |
ConstantScoreQuery.ConstantWeight |
Modifier and Type | Field and Description |
---|---|
protected Filter |
filter |
protected Query |
query |
Constructor and Description |
---|
ConstantScoreQuery(Filter filter)
Wraps a Filter as a Query.
|
ConstantScoreQuery(Query query)
Strips off scores from the passed in Query.
|
Modifier and Type | Method and Description |
---|---|
Weight |
createWeight(IndexSearcher searcher)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object o) |
void |
extractTerms(Set<Term> terms)
Expert: adds all terms occurring in this query to the terms set.
|
Filter |
getFilter()
Returns the encapsulated filter, returns
null if a query is wrapped. |
Query |
getQuery()
Returns the encapsulated query, returns
null if a filter is wrapped. |
int |
hashCode() |
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
public ConstantScoreQuery(Query query)
public ConstantScoreQuery(Filter filter)
new ConstantScoreQuery(new QueryWrapperFilter(query))
, instead
use ConstantScoreQuery(Query)
!public Filter getFilter()
null
if a query is wrapped.public Query getQuery()
null
if a filter is wrapped.public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public void extractTerms(Set<Term> terms)
Query
rewritten
form.extractTerms
in class Query
public Weight createWeight(IndexSearcher searcher) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
IOException
public String toString(String field)
Query
field
assumed to be the
default field and omitted.Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.