List of usage examples for org.apache.lucene.queryparser.flexible.standard.nodes RegexpQueryNode getTag
@Override
public Object getTag(String tagName)
From source file:com.sindicetech.siren.qparser.keyword.builders.NodeRegexpQueryNodeBuilder.java
License:Open Source License
public NodeQuery build(final QueryNode queryNode) throws QueryNodeException { final RegexpQueryNode regexpNode = (RegexpQueryNode) queryNode; final NodeRegexpQuery q = new NodeRegexpQuery( new Term(regexpNode.getFieldAsString(), regexpNode.textToBytesRef())); // assign the datatype. We must always have a datatype assigned. q.setDatatype((String) queryNode.getTag(DatatypeQueryNode.DATATYPE_TAGID)); final MultiNodeTermQuery.RewriteMethod method = (MultiNodeTermQuery.RewriteMethod) queryNode .getTag(MultiNodeTermRewriteMethodProcessor.TAG_ID); if (method != null) { q.setRewriteMethod(method);//from w w w. j av a 2 s. c o m } // if it is tagged as a span query if (regexpNode.getTag(QueryTypeProcessor.QUERYTYPE_TAG) == QueryTypeProcessor.SPAN_QUERYTYPE) { return new MultiTermSpanQuery<>(q); } else { return q; } }