public abstract class Query extends Object implements Cloneable
Instantiable subclasses are:
TermQuery
BooleanQuery
WildcardQuery
PhraseQuery
PrefixQuery
MultiPhraseQuery
FuzzyQuery
RegexpQuery
TermRangeQuery
NumericRangeQuery
ConstantScoreQuery
DisjunctionMaxQuery
MatchAllDocsQuery
See also the family of Span Queries
and additional queries available in the Queries module
Constructor and Description |
---|
Query() |
Modifier and Type | Method and Description |
---|---|
Query |
clone()
Deprecated.
Cloning was only useful for modifying boosts. Now that
setBoost(float) is deprecated, queries should be considered
immutable. |
Weight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object obj) |
float |
getBoost()
Deprecated.
Use
BoostQuery instead to apply boosts. |
int |
hashCode() |
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
void |
setBoost(float b)
Deprecated.
Use
BoostQuery instead to apply boosts. |
String |
toString()
Prints a query to a string.
|
abstract String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
@Deprecated public void setBoost(float b)
BoostQuery
instead to apply boosts.b
.@Deprecated public float getBoost()
BoostQuery
instead to apply boosts.public abstract String toString(String field)
field
assumed to be the
default field and omitted.public final String toString()
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
Only implemented by primitive queries, which re-write to themselves.
needsScores
- True if document scores (Scorer.score()
) or match
frequencies (Scorer.freq()
) are needed.IOException
public Query rewrite(IndexReader reader) throws IOException
IOException
@Deprecated public Query clone()
setBoost(float)
is deprecated, queries should be considered
immutable.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.