public abstract class Query extends Object
Instantiable subclasses are:
TermQuery
BooleanQuery
WildcardQuery
PhraseQuery
PrefixQuery
MultiPhraseQuery
FuzzyQuery
RegexpQuery
TermRangeQuery
PointRangeQuery
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 |
---|---|
Weight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object obj) |
int |
hashCode() |
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
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. |
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
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.