public class NodePrefixQuery extends MultiNodeTermQuery
NodePrimitiveQuery that matches documents containing terms with a
specified prefix. A PrefixQuery is built by QueryParser for input like
app*.
This query uses the
MultiNodeTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite
method.
Code taken from PrefixQuery and adapted for SIREn.
MultiNodeTermQuery.RewriteMethodCONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITEdatatypeancestor, levelConstraint, lowerBound, upperBound| Constructor and Description |
|---|
NodePrefixQuery(org.apache.lucene.index.Term prefix)
Constructs a query for terms starting with
prefix. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
org.apache.lucene.index.Term |
getPrefix()
Returns the prefix of this query.
|
protected org.apache.lucene.index.TermsEnum |
getTermsEnum(org.apache.lucene.index.Terms terms,
org.apache.lucene.util.AttributeSource atts)
Construct the enumeration to be used, expanding the
pattern term.
|
int |
hashCode() |
String |
toString(String field)
Prints a user-readable version of this query.
|
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethodsetDatatype, wrapToStringWithDatatypegetDocsNodesAndPositionsEnum, getLevelConstraint, getNodeConstraint, setAncestorPointer, setLevelConstraint, setNodeConstraint, setNodeConstraintpublic NodePrefixQuery(org.apache.lucene.index.Term prefix)
prefix.public org.apache.lucene.index.Term getPrefix()
protected org.apache.lucene.index.TermsEnum getTermsEnum(org.apache.lucene.index.Terms terms,
org.apache.lucene.util.AttributeSource atts)
throws IOException
MultiNodeTermQueryTermsEnum.EMPTY if no
terms match). The TermsEnum must already be
positioned to the first matching term.
The given AttributeSource is passed by the MultiNodeTermQuery.RewriteMethod to
provide attributes, the rewrite method uses to inform about e.g. maximum competitive boosts.
This is currently only used by TopNodeTermsRewritegetTermsEnum in class MultiNodeTermQueryIOExceptionpublic String toString(String field)
toString in class org.apache.lucene.search.Querypublic int hashCode()
hashCode in class MultiNodeTermQuerypublic boolean equals(Object obj)
equals in class MultiNodeTermQueryCopyright © 2014. All rights reserved.