@Override public BooleanQuery build(QueryNode queryNode) throws QueryNodeException { StandardBooleanQueryNode booleanNode = (StandardBooleanQueryNode) queryNode; BooleanQuery.Builder bQuery = new BooleanQuery.Builder(); bQuery.setDisableCoord(booleanNode.isDisableCoord()); List<QueryNode> children = booleanNode.getChildren(); if (children != null) { for (QueryNode child : children) { Object obj = child.getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID); if (obj != null) { Query query = (Query) obj; try { bQuery.add(query, getModifierValue(child)); } catch (TooManyClauses ex) { throw new QueryNodeException(new MessageImpl( QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery .getMaxClauseCount(), queryNode .toQueryString(new EscapeQuerySyntaxImpl())), ex); } } } } return bQuery.build(); }
new StandardBooleanQueryNode(children, positionCount==1)); } else { QueryNode q = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(),false); QueryNode currentQuery = null; for (int i = 0; i < numTokens; i++) { if (!(currentQuery instanceof BooleanQueryNode)) { QueryNode t = currentQuery; currentQuery = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(), true); ((BooleanQueryNode)currentQuery).add(t);
new StandardBooleanQueryNode(children, positionCount==1)); } else { QueryNode q = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(),false); QueryNode currentQuery = null; for (int i = 0; i < numTokens; i++) { if (!(currentQuery instanceof BooleanQueryNode)) { QueryNode t = currentQuery; currentQuery = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(), true); ((BooleanQueryNode)currentQuery).add(t);
@Override public BooleanQuery build(QueryNode queryNode) throws QueryNodeException { StandardBooleanQueryNode booleanNode = (StandardBooleanQueryNode) queryNode; BooleanQuery.Builder bQuery = new BooleanQuery.Builder(); bQuery.setDisableCoord(booleanNode.isDisableCoord()); List<QueryNode> children = booleanNode.getChildren(); if (children != null) { for (QueryNode child : children) { Object obj = child.getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID); if (obj != null) { Query query = (Query) obj; try { bQuery.add(query, getModifierValue(child)); } catch (TooManyClauses ex) { throw new QueryNodeException(new MessageImpl( QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery .getMaxClauseCount(), queryNode .toQueryString(new EscapeQuerySyntaxImpl())), ex); } } } } return bQuery.build(); }