public class WildcardQueryNodeProcessor extends QueryNodeProcessorImpl
StandardSyntaxParser creates PrefixWildcardQueryNode nodes which
have values containing the prefixed wildcard. However, Lucene
PrefixQuery cannot contain the prefixed wildcard. So, this processor
basically removed the prefixed wildcard from the
PrefixWildcardQueryNode value.PrefixQuery,
PrefixWildcardQueryNode| Modifier and Type | Field and Description |
|---|---|
private static java.util.regex.Pattern |
WILDCARD_PATTERN |
| Constructor and Description |
|---|
WildcardQueryNodeProcessor() |
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.String |
analyzeWildcard(Analyzer a,
java.lang.String field,
java.lang.String wildcard) |
private boolean |
isPrefixWildcard(java.lang.CharSequence text) |
private boolean |
isWildcard(java.lang.CharSequence text) |
protected QueryNode |
postProcessNode(QueryNode node)
This method is invoked for every node when walking up the tree.
|
protected QueryNode |
preProcessNode(QueryNode node)
This method is invoked for every node when walking down the tree.
|
protected java.util.List<QueryNode> |
setChildrenOrder(java.util.List<QueryNode> children)
This method is invoked for every node that has at least on child.
|
getQueryConfigHandler, process, processChildren, setQueryConfigHandlerprivate static java.lang.String analyzeWildcard(Analyzer a, java.lang.String field, java.lang.String wildcard)
protected QueryNode postProcessNode(QueryNode node) throws QueryNodeException
QueryNodeProcessorImplpostProcessNode in class QueryNodeProcessorImplnode - node the query node to be post-processedQueryNodeException - if something goes wrong during the query node processingprivate boolean isWildcard(java.lang.CharSequence text)
private boolean isPrefixWildcard(java.lang.CharSequence text)
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException
QueryNodeProcessorImplpreProcessNode in class QueryNodeProcessorImplnode - the query node to be pre-processedQueryNodeException - if something goes wrong during the query node processingprotected java.util.List<QueryNode> setChildrenOrder(java.util.List<QueryNode> children) throws QueryNodeException
QueryNodeProcessorImplQueryNodeProcessorImpl.postProcessNode(QueryNode) is invoked.setChildrenOrder in class QueryNodeProcessorImplchildren - the list containing all current node's childrenQueryNodeException - if something goes wrong during the query node processing