Examples of StandardBooleanQueryNode


Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }

          return new GroupQueryNode(
              new StandardBooleanQueryNode(children, true));

        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }
          if (positionCount == 1)
            return new GroupQueryNode(
              new StandardBooleanQueryNode(children, true));
          else
            return new StandardBooleanQueryNode(children, false);

        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }
          if (positionCount == 1)
            return new GroupQueryNode(
              new StandardBooleanQueryNode(children, true));
          else
            return new StandardBooleanQueryNode(children, false);

        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

  public StandardBooleanQueryNodeBuilder() {
    // empty constructor
  }

  public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
    StandardBooleanQueryNode booleanNode = (StandardBooleanQueryNode) queryNode;

    BooleanQuery bQuery = new BooleanQuery(booleanNode.isDisableCoord());
    List<QueryNode> children = booleanNode.getChildren();

    if (children != null) {

      for (QueryNode child : children) {
        Object obj = child.getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }
          if (positionCount == 1)
            return new GroupQueryNode(
              new StandardBooleanQueryNode(children, true));
          else
            return new StandardBooleanQueryNode(children, false);

        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

  public StandardBooleanQueryNodeBuilder() {
    // empty constructor
  }

  public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
    StandardBooleanQueryNode booleanNode = (StandardBooleanQueryNode) queryNode;

    BooleanQuery bQuery = new BooleanQuery(booleanNode.isDisableCoord());
    List<QueryNode> children = booleanNode.getChildren();

    if (children != null) {

      for (QueryNode child : children) {
        Object obj = child.getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }

          return new GroupQueryNode(new StandardBooleanQueryNode(children, true));

        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();
View Full Code Here

Examples of org.apache.lucene.queryParser.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }
          return new GroupQueryNode(
              new StandardBooleanQueryNode(children, positionCount==1));
        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();

          List<FieldQueryNode> multiTerms = new ArrayList<FieldQueryNode>();
View Full Code Here

Examples of org.apache.lucene.queryparser.flexible.standard.nodes.StandardBooleanQueryNode

             
              children.add(new FieldQueryNode(field, term, -1, -1));
             
            }
            return new GroupQueryNode(
                new StandardBooleanQueryNode(children, positionCount==1));
           
          } else {
            // multiple positions
            QueryNode q = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(),false);
            QueryNode currentQuery = null;
            for (int i = 0; i < numTokens; i++) {
              String term = null;
              try {
                boolean hasNext = buffer.incrementToken();
                assert hasNext == true;
                term = termAtt.toString();
              } catch (IOException e) {
                // safe to ignore, because we know the number of tokens
              }
              if (posIncrAtt != null && posIncrAtt.getPositionIncrement() == 0) {
                if (!(currentQuery instanceof BooleanQueryNode)) {
                  QueryNode t = currentQuery;
                  currentQuery = new StandardBooleanQueryNode(Collections.<QueryNode>emptyList(), true);
                  ((BooleanQueryNode)currentQuery).add(t);
                }
                ((BooleanQueryNode)currentQuery).add(new FieldQueryNode(field, term, -1, -1));
              } else {
                if (currentQuery != null) {
                  if (this.defaultOperator == Operator.OR) {
                    q.add(currentQuery);
                  } else {
                    q.add(new ModifierQueryNode(currentQuery, Modifier.MOD_REQ));
                  }
                }
                currentQuery = new FieldQueryNode(field, term, -1, -1);
              }
            }
            if (this.defaultOperator == Operator.OR) {
              q.add(currentQuery);
            } else {
              q.add(new ModifierQueryNode(currentQuery, Modifier.MOD_REQ));
            }
           
            if (q instanceof BooleanQueryNode) {
              q = new GroupQueryNode(q);
            }
View Full Code Here

Examples of org.apache.lucene.queryparser.flexible.standard.nodes.StandardBooleanQueryNode

            children.add(new FieldQueryNode(field, term, -1, -1));

          }
          return new GroupQueryNode(
            new StandardBooleanQueryNode(children, positionCount==1));
        } else {
          // phrase query:
          MultiPhraseQueryNode mpq = new MultiPhraseQueryNode();

          List<FieldQueryNode> multiTerms = new ArrayList<FieldQueryNode>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.