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.RewriteMethod
CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE
datatype
ancestor, 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, setRewriteMethod
setDatatype, wrapToStringWithDatatype
getDocsNodesAndPositionsEnum, getLevelConstraint, getNodeConstraint, setAncestorPointer, setLevelConstraint, setNodeConstraint, setNodeConstraint
public 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
MultiNodeTermQuery
TermsEnum.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 TopNodeTermsRewrite
getTermsEnum
in class MultiNodeTermQuery
IOException
public String toString(String field)
toString
in class org.apache.lucene.search.Query
public int hashCode()
hashCode
in class MultiNodeTermQuery
public boolean equals(Object obj)
equals
in class MultiNodeTermQuery
Copyright © 2014. All rights reserved.