本文整理了Java中org.apache.lucene.queryparser.flexible.core.nodes.QueryNode.setTag
方法的一些代码示例,展示了QueryNode.setTag
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryNode.setTag
方法的具体详情如下:
包路径:org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
类名称:QueryNode
方法名:setTag
[英]Associate the specified value with the specified tagName. If the tagName already exists, the old value is replaced. The tagName and value cannot be null. tagName will be converted to lowercase.
[中]
代码示例来源:origin: org.infinispan/infinispan-embedded-query
protected void tagModifierButDoNotOverride(QueryNode node, Modifier mod) {
if (node instanceof ModifierQueryNode) {
ModifierQueryNode modNode = (ModifierQueryNode) node;
if (modNode.getModifier() == Modifier.MOD_NONE) {
node.setTag(TAG_MODIFIER, mod);
}
} else {
node.setTag(TAG_MODIFIER, ModifierQueryNode.Modifier.MOD_REQ);
}
}
代码示例来源:origin: harbby/presto-connectors
protected void tagModifierButDoNotOverride(QueryNode node, Modifier mod) {
if (node instanceof ModifierQueryNode) {
ModifierQueryNode modNode = (ModifierQueryNode) node;
if (modNode.getModifier() == Modifier.MOD_NONE) {
node.setTag(TAG_MODIFIER, mod);
}
} else {
node.setTag(TAG_MODIFIER, ModifierQueryNode.Modifier.MOD_REQ);
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
QueryNode parent = node.getParent();
if (node instanceof BooleanQueryNode) {
if (parent instanceof BooleanQueryNode) {
node.setTag(TAG_REMOVE, Boolean.TRUE); // no precedence
} else {
node.setTag(TAG_BOOLEAN_ROOT, Boolean.TRUE);
}
} else if (parent instanceof BooleanQueryNode) {
if ((parent instanceof AndQueryNode)
|| (usingAnd && isDefaultBooleanQueryNode(parent))) {
tagModifierButDoNotOverride(node, ModifierQueryNode.Modifier.MOD_REQ);
}
}
return node;
}
代码示例来源:origin: harbby/presto-connectors
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
QueryNode parent = node.getParent();
if (node instanceof BooleanQueryNode) {
if (parent instanceof BooleanQueryNode) {
node.setTag(TAG_REMOVE, Boolean.TRUE); // no precedence
} else {
node.setTag(TAG_BOOLEAN_ROOT, Boolean.TRUE);
}
} else if (parent instanceof BooleanQueryNode) {
if ((parent instanceof AndQueryNode)
|| (usingAnd && isDefaultBooleanQueryNode(parent))) {
tagModifierButDoNotOverride(node, ModifierQueryNode.Modifier.MOD_REQ);
}
}
return node;
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
@Override
protected QueryNode postProcessNode(QueryNode node) {
// set setMultiTermRewriteMethod for WildcardQueryNode and
// PrefixWildcardQueryNode
if (node instanceof WildcardQueryNode
|| node instanceof AbstractRangeQueryNode || node instanceof RegexpQueryNode) {
MultiTermQuery.RewriteMethod rewriteMethod = getQueryConfigHandler().get(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD);
if (rewriteMethod == null) {
// This should not happen, this configuration is set in the
// StandardQueryConfigHandler
throw new IllegalArgumentException(
"StandardQueryConfigHandler.ConfigurationKeys.MULTI_TERM_REWRITE_METHOD should be set on the QueryConfigHandler");
}
// use a TAG to take the value to the Builder
node.setTag(MultiTermRewriteMethodProcessor.TAG_ID, rewriteMethod);
}
return node;
}
代码示例来源:origin: harbby/presto-connectors
@Override
protected QueryNode postProcessNode(QueryNode node) {
// set setMultiTermRewriteMethod for WildcardQueryNode and
// PrefixWildcardQueryNode
if (node instanceof WildcardQueryNode
|| node instanceof AbstractRangeQueryNode || node instanceof RegexpQueryNode) {
MultiTermQuery.RewriteMethod rewriteMethod = getQueryConfigHandler().get(ConfigurationKeys.MULTI_TERM_REWRITE_METHOD);
if (rewriteMethod == null) {
// This should not happen, this configuration is set in the
// StandardQueryConfigHandler
throw new IllegalArgumentException(
"StandardQueryConfigHandler.ConfigurationKeys.MULTI_TERM_REWRITE_METHOD should be set on the QueryConfigHandler");
}
// use a TAG to take the value to the Builder
node.setTag(MultiTermRewriteMethodProcessor.TAG_ID, rewriteMethod);
}
return node;
}
代码示例来源:origin: sirensolutions/siren
@Override
protected QueryNode postProcessNode(final QueryNode node) {
// set setMultiTermRewriteMethod for WildcardQueryNode and
// PrefixWildcardQueryNode
if (node instanceof WildcardQueryNode ||
node instanceof AbstractRangeQueryNode ||
node instanceof RegexpQueryNode) {
final MultiNodeTermQuery.RewriteMethod rewriteMethod = this.getQueryConfigHandler().get(KeywordConfigurationKeys.MULTI_NODE_TERM_REWRITE_METHOD);
if (rewriteMethod == null) {
// This should not happen, this configuration is set in the
// StandardQueryConfigHandler
throw new IllegalArgumentException(
"KeywordConfigurationKeys.MULTI_NODE_TERM_REWRITE_METHOD should be set on the QueryConfigHandler");
}
// use a TAG to take the value to the Builder
node.setTag(MultiNodeTermRewriteMethodProcessor.TAG_ID, rewriteMethod);
}
return node;
}
代码示例来源:origin: rdelbru/SIREn
@Override
protected QueryNode postProcessNode(final QueryNode node) {
// set setMultiTermRewriteMethod for WildcardQueryNode and
// PrefixWildcardQueryNode
if (node instanceof WildcardQueryNode ||
node instanceof AbstractRangeQueryNode ||
node instanceof RegexpQueryNode) {
final MultiNodeTermQuery.RewriteMethod rewriteMethod = this.getQueryConfigHandler().get(KeywordConfigurationKeys.MULTI_NODE_TERM_REWRITE_METHOD);
if (rewriteMethod == null) {
// This should not happen, this configuration is set in the
// StandardQueryConfigHandler
throw new IllegalArgumentException(
"KeywordConfigurationKeys.MULTI_NODE_TERM_REWRITE_METHOD should be set on the QueryConfigHandler");
}
// use a TAG to take the value to the Builder
node.setTag(MultiNodeTermRewriteMethodProcessor.TAG_ID, rewriteMethod);
}
return node;
}
代码示例来源:origin: sirensolutions/siren
@Override
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
final QueryConfigHandler cOnf= this.getQueryConfigHandler();
// If the current node is a span group query node, transfer its slop to its child
if (node instanceof SpanGroupQueryNode) {
SpanGroupQueryNode spanGroupQueryNode = (SpanGroupQueryNode) node;
// transfer the slop to its child
spanGroupQueryNode.getChild().setTag(SLOP_TAG, spanGroupQueryNode.getSlop());
// transfer the slop to its child
spanGroupQueryNode.getChild().setTag(INORDER_TAG, spanGroupQueryNode.isInOrder());
}
return node;
}
代码示例来源:origin: NationalSecurityAgency/datawave
childNode.setTag(ORIGINAL_SLOP, slopNode.getValue());
QueryNode newChildNode = preProcessNode(childNode);
if (childNode != newChildNode) {
代码示例来源:origin: rdelbru/SIREn
twig.getRoot().setTag(DatatypeQueryNode.DATATYPE_TAGID, JSONDatatype.JSON_FIELD);
node.setTag(DatatypeQueryNode.DATATYPE_TAGID, datatype);
node.setTag(DatatypeQueryNode.DATATYPE_TAGID, XSDDatatype.XSD_STRING);
代码示例来源:origin: sirensolutions/siren
dt.getChild().setTag(DatatypeQueryNode.DATATYPE_TAGID, datatype);
final TwigQueryNode twig = (TwigQueryNode) node;
if (twig.getTag(DatatypeQueryNode.DATATYPE_TAGID) == null) {
twig.getChild().setTag(DatatypeQueryNode.DATATYPE_TAGID, this.getDefaultDatatype(conf));
twig.getChild().setTag(DatatypeQueryNode.DATATYPE_TAGID, this.getDatatype(conf, node));
twig.getRoot().setTag(DatatypeQueryNode.DATATYPE_TAGID, JSONDatatype.JSON_FIELD);
child.setTag(DatatypeQueryNode.DATATYPE_TAGID, this.getDatatype(conf, node));
代码示例来源:origin: org.infinispan/infinispan-embedded-query
private void processNode(QueryNode node, QueryBuilder builder)
throws QueryNodeException {
if (builder == null) {
throw new QueryNodeException(new MessageImpl(
QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, node
.toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
.getName()));
}
Object obj = builder.build(node);
if (obj != null) {
node.setTag(QUERY_TREE_BUILDER_TAGID, obj);
}
}
代码示例来源:origin: harbby/presto-connectors
private void processNode(QueryNode node, QueryBuilder builder)
throws QueryNodeException {
if (builder == null) {
throw new QueryNodeException(new MessageImpl(
QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, node
.toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
.getName()));
}
Object obj = builder.build(node);
if (obj != null) {
node.setTag(QUERY_TREE_BUILDER_TAGID, obj);
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
} else {
node.setTag(NODE_PROCESSED, Boolean.TRUE);
QueryNode n = new QuotedFieldQueryNode(field, new UnescapedCharSequence(tokenizedText), -1, -1);
n.setTag(NODE_PROCESSED, Boolean.TRUE);
代码示例来源:origin: sirensolutions/siren
@Override
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {
// If the current node is a group query node, check the query type and assign it to its children
if (node instanceof GroupQueryNode) {
GroupQueryNode groupQueryNode = (GroupQueryNode) node;
String queryType = null;
if (node instanceof NodeGroupQueryNode) {
queryType = NODE_QUERYTYPE;
}
else if (node instanceof SpanGroupQueryNode) {
queryType = SPAN_QUERYTYPE;
}
else {
throw new QueryNodeException(new MessageImpl("Invalid GroupQueryNode received",
node.toQueryString(new EscapeQuerySyntaxImpl())));
}
// transfer the query type to its child
groupQueryNode.getChild().setTag(QUERYTYPE_TAG, queryType);
}
// in any other cases, if the node is not a leaf node, transfer the query type to its children
else if (!node.isLeaf()) {
if (node.getTag(QUERYTYPE_TAG) != null) {
for (final QueryNode child : node.getChildren()) {
child.setTag(QUERYTYPE_TAG, node.getTag(QUERYTYPE_TAG));
}
}
}
return node;
}
代码示例来源:origin: sirensolutions/siren
node.setTag(DatatypeQueryNode.DATATYPE_TAGID, datatype);
代码示例来源:origin: sirensolutions/siren
node.setTag(DatatypeQueryNode.DATATYPE_TAGID, datatype);