class TermsQuery extends MultiTermQuery implements Accountable
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBlendedFreqScoringRewrite, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite| Modifier and Type | Field and Description |
|---|---|
private static long |
BASE_RAM_BYTES |
private java.lang.String |
fromField |
private Query |
fromQuery |
private java.lang.Object |
indexReaderContextId |
private int[] |
ords |
private long |
ramBytesUsed |
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.
|
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
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, setRewriteMethodclassHash, createWeight, sameClassAs, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildResourcesprivate static final long BASE_RAM_BYTES
private final BytesRefHash terms
private final int[] ords
private final java.lang.String fromField
private final Query fromQuery
private final java.lang.Object indexReaderContextId
private final long ramBytesUsed
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)
Queryprotected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws java.io.IOException
MultiTermQueryTermsEnum.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 TopTermsRewritegetTermsEnum in class MultiTermQueryjava.io.IOExceptionpublic java.lang.String toString(java.lang.String string)
Queryfield assumed to be the
default field and omitted.public boolean equals(java.lang.Object obj)
QueryQueryCache 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 MultiTermQueryQuery.sameClassAs(Object),
Query.classHash()public int hashCode()
QueryQueryCache works properly.hashCode in class MultiTermQueryQuery.equals(Object)public long ramBytesUsed()
AccountableramBytesUsed in interface Accountable