class TermsQuery extends MultiTermQuery
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBlendedFreqScoringRewrite, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
fromField |
private Query |
fromQuery |
private java.lang.Object |
indexReaderContextId |
private int[] |
ords |
private BytesRefHash |
terms |
CONSTANT_SCORE_BOOLEAN_REWRITE, CONSTANT_SCORE_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_REWRITE
Constructor and Description |
---|
TermsQuery(java.lang.String toField,
BytesRefHash terms,
java.lang.String fromField,
Query fromQuery,
java.lang.Object indexReaderContextId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Override and implement query instance equivalence properly in a subclass.
|
protected TermsEnum |
getTermsEnum(Terms terms,
AttributeSource atts)
Construct the enumeration to be used, expanding the
pattern term.
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
java.lang.String |
toString(java.lang.String string)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod
classHash, createWeight, sameClassAs, toString
private final BytesRefHash terms
private final int[] ords
private final java.lang.String fromField
private final Query fromQuery
private final java.lang.Object indexReaderContextId
TermsQuery(java.lang.String toField, BytesRefHash terms, java.lang.String fromField, Query fromQuery, java.lang.Object indexReaderContextId)
toField
- The field that should contain terms that are specified in the next parameter.terms
- The terms that matching documents should have. The terms must be sorted by natural order.indexReaderContextId
- Refers to the top level index reader used to create the set of terms in the previous parameter.public void visit(QueryVisitor visitor)
Query
protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws java.io.IOException
MultiTermQuery
TermsEnum.EMPTY
if no
terms match). The TermsEnum must already be
positioned to the first matching term.
The given AttributeSource
is passed by the MultiTermQuery.RewriteMethod
to
provide attributes, the rewrite method uses to inform about e.g. maximum competitive boosts.
This is currently only used by TopTermsRewrite
getTermsEnum
in class MultiTermQuery
java.io.IOException
public java.lang.String toString(java.lang.String string)
Query
field
assumed to be the
default field and omitted.public boolean equals(java.lang.Object obj)
Query
QueryCache
works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals
in class MultiTermQuery
Query.sameClassAs(Object)
,
Query.classHash()
public int hashCode()
Query
QueryCache
works properly.hashCode
in class MultiTermQuery
Query.equals(Object)