private QueryConfigHandler queryConfig;
@Override
public QueryNode process(final QueryNode queryTree)
throws QueryNodeException {
final TopLevelQueryNode top = (TopLevelQueryNode) queryTree;
if (this.getQueryConfigHandler().has(KeywordConfigurationKeys.ALLOW_TWIG)) {
if (!this.getQueryConfigHandler().get(KeywordConfigurationKeys.ALLOW_TWIG)) {
// Wraps the children into a BooleanQueryNode, so that the parent
// pointers are correct.
// This relies on the BooleanSingleChildOptimizationQueryNodeProcessor
return new BooleanQueryNode(top.getChildren());
}
} else {
throw new IllegalArgumentException("KeywordConfigurationKeys.ALLOW_TWIG should be set on the KeywordQueryConfigHandler");
}
return queryTree;