Package org.apache.lucene.queryParser.standard.nodes

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


      }

      lower.setText(part1);
      upper.setText(part2);

      return new RangeQueryNode(lower, upper, collator);

    }

    return node;
View Full Code Here


      }

      lower.setText(part1);
      upper.setText(part2);

      return new RangeQueryNode(lower, upper, collator);

    }

    return node;
View Full Code Here

  public RangeQueryNodeBuilder() {
    // empty constructor
  }

  public TermRangeQuery build(QueryNode queryNode) throws QueryNodeException {
    RangeQueryNode rangeNode = (RangeQueryNode) queryNode;
    ParametricQueryNode upper = rangeNode.getUpperBound();
    ParametricQueryNode lower = rangeNode.getLowerBound();

    boolean lowerInclusive = false;
    boolean upperInclusive = false;

    if (upper.getOperator() == CompareOperator.LE) {
      upperInclusive = true;
    }

    if (lower.getOperator() == CompareOperator.GE) {
      lowerInclusive = true;
    }

    String field = rangeNode.getField().toString();

    TermRangeQuery rangeQuery = new TermRangeQuery(field, lower
        .getTextAsString(), upper.getTextAsString(), lowerInclusive,
        upperInclusive, rangeNode.getCollator());
   
    MultiTermQuery.RewriteMethod method = (MultiTermQuery.RewriteMethod) queryNode
        .getTag(MultiTermRewriteMethodProcessor.TAG_ID);
   
    if (method != null) {
View Full Code Here

      }

      lower.setText(part1);
      upper.setText(part2);

      return new RangeQueryNode(lower, upper, collator);

    }

    return node;
View Full Code Here

  public RangeQueryNodeBuilder() {
    // empty constructor
  }

  public TermRangeQuery build(QueryNode queryNode) throws QueryNodeException {
    RangeQueryNode rangeNode = (RangeQueryNode) queryNode;
    ParametricQueryNode upper = rangeNode.getUpperBound();
    ParametricQueryNode lower = rangeNode.getLowerBound();

    boolean lowerInclusive = false;
    boolean upperInclusive = false;

    if (upper.getOperator() == CompareOperator.LE) {
      upperInclusive = true;
    }

    if (lower.getOperator() == CompareOperator.GE) {
      lowerInclusive = true;
    }

    String field = rangeNode.getField().toString();

    TermRangeQuery rangeQuery = new TermRangeQuery(field, lower
        .getTextAsString(), upper.getTextAsString(), lowerInclusive,
        upperInclusive, rangeNode.getCollator());
   
    MultiTermQuery.RewriteMethod method = (MultiTermQuery.RewriteMethod)queryNode.getTag(MultiTermRewriteMethodAttribute.TAG_ID);
    if (method != null) {
      rangeQuery.setRewriteMethod(method);
    }
View Full Code Here

      }

      lower.setText(part1);
      upper.setText(part2);

      return new RangeQueryNode(lower, upper, collator);

    }

    return node;
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryParser.standard.nodes.RangeQueryNode

Copyright © 2018 www.massapicom. 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.