public NodeQuery build(final QueryNode queryNode) throws QueryNodeException {
final RegexpQueryNode regexpNode = (RegexpQueryNode) queryNode;
final NodeRegexpQuery q = new NodeRegexpQuery(new Term(regexpNode.getFieldAsString(),
regexpNode.textToBytesRef()));
final MultiNodeTermQuery.RewriteMethod method = (MultiNodeTermQuery.RewriteMethod) queryNode
.getTag(MultiNodeTermRewriteMethodProcessor.TAG_ID);
if (method != null) {
q.setRewriteMethod(method);