public class NodeWildcardQuery extends NodeAutomatonQuery
NodePrimitiveQuery
that implements the wildcard search query.
Supported wildcards are *
, which
matches any character sequence (including the empty one), and ?
,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
a Wildcard term should not start with the wildcards *
.
This query uses the MultiNodeTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
Code taken from WildcardQuery
and adapted for SIREn.
AutomatonQuery
MultiNodeTermQuery.RewriteMethod
Modifier and Type | Field and Description |
---|---|
static char |
WILDCARD_CHAR
Char equality with support for wildcards
|
static char |
WILDCARD_ESCAPE
Escape character
|
static char |
WILDCARD_STRING
String equality with support for wildcards
|
automaton, compiled, term
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 |
---|
NodeWildcardQuery(org.apache.lucene.index.Term term) |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.index.Term |
getTerm()
Returns the pattern term.
|
static org.apache.lucene.util.automaton.Automaton |
toAutomaton(org.apache.lucene.index.Term wildcardquery)
Convert wildcard syntax into an automaton.
|
String |
toString(String field)
Prints a user-readable version of this query.
|
equals, getTermsEnum, hashCode
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod
setDatatype, wrapToStringWithDatatype
getDocsNodesAndPositionsEnum, getLevelConstraint, getNodeConstraint, setAncestorPointer, setLevelConstraint, setNodeConstraint, setNodeConstraint
public static final char WILDCARD_STRING
public static final char WILDCARD_CHAR
public static final char WILDCARD_ESCAPE
public static org.apache.lucene.util.automaton.Automaton toAutomaton(org.apache.lucene.index.Term wildcardquery)
public org.apache.lucene.index.Term getTerm()
public String toString(String field)
toString
in class NodeAutomatonQuery
Copyright © 2014. All rights reserved.