Package org.apache.lucene.queryParser.core.nodes

Examples of org.apache.lucene.queryParser.core.nodes.QueryNode


  }

  final public QueryNode Term(CharSequence field) throws ParseException {
  Token term, boost=null, fuzzySlop=null, goop1, goop2;
  boolean fuzzy = false;
  QueryNode q =null;
  ParametricQueryNode qLower, qUpper;
  float defaultMinSimilarity = 0.5f;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case TERM:
    case NUMBER:
View Full Code Here


    readTree(queryTree);

    List<QueryNode> actualQueryNodeList = this.queryNodeList;

    for (int i = 0; i < actualQueryNodeList.size(); i++) {
      QueryNode node = actualQueryNodeList.get(i);

      if (node instanceof GroupQueryNode) {
        actualQueryNodeList.set(i, process(node));
      }
View Full Code Here

  public void testBasicDemo() throws Exception {
    SyntaxParser queryParser = new StandardSyntaxParser();

    // convert the CharSequence into a QueryNode tree
    QueryNode queryTree = queryParser.parse("body:text", null);

    // create a config handler with a attribute used in
    // UniqueFieldQueryNodeProcessor
    QueryConfigHandler spanQueryConfigHandler = new SpansQueryConfigHandler();
    spanQueryConfigHandler.set(SpansQueryConfigHandler.UNIQUE_FIELD, "index");
View Full Code Here

  public SpanQuery getSpanQuery(String uniqueField, CharSequence query)
      throws QueryNodeException {
   
    this.spanQueryConfigHandler.set(SpansQueryConfigHandler.UNIQUE_FIELD, uniqueField);

    QueryNode queryTree = this.queryParser.parse(query, "defaultField");
    queryTree = this.spanProcessorPipeline.process(queryTree);

    return this.spansQueryTreeBuilder.build(queryTree);

  }
View Full Code Here

  }

  public Query parse(String query) throws ParseException {

    try {
      QueryNode queryTree = this.syntaxParser.parse(query, getField());
      queryTree = this.processorPipeline.process(queryTree);
      return this.builder.build(queryTree);

    } catch (QueryNodeException e) {
      throw new ParseException("parse exception");
View Full Code Here

  public void testBasicDemo() throws Exception {
    SyntaxParser queryParser = new StandardSyntaxParser();

    // convert the CharSequence into a QueryNode tree
    QueryNode queryTree = queryParser.parse("body:text", null);

    // create a config handler with a attribute used in
    // UniqueFieldQueryNodeProcessor
    QueryConfigHandler spanQueryConfigHandler = new SpansQueryConfigHandler();
    UniqueFieldAttribute uniqueFieldAtt = spanQueryConfigHandler
View Full Code Here

    readTree(queryTree);

    List<QueryNode> actualQueryNodeList = this.queryNodeList;

    for (int i = 0; i < actualQueryNodeList.size(); i++) {
      QueryNode node = actualQueryNodeList.get(i);

      if (node instanceof GroupQueryNode) {
        actualQueryNodeList.set(i, process(node));
      }
View Full Code Here

  }

  public Query parse(String query) throws ParseException {

    try {
      QueryNode queryTree = this.syntaxParser.parse(query, getField());
      queryTree = this.processorPipeline.process(queryTree);
      return this.builder.build(queryTree);

    } catch (QueryNodeException e) {
      throw new ParseException("parse exception");
View Full Code Here

    if (node instanceof BooleanQueryNode) {
      List<QueryNode> children = node.getChildren();

      if (children != null && children.size() == 1) {
        QueryNode child = children.get(0);

        if (child instanceof ModifierQueryNode) {
          ModifierQueryNode modNode = (ModifierQueryNode) child;

          if (modNode instanceof BooleanModifierNode
View Full Code Here

     */
    public QueryNode parse(CharSequence query, CharSequence field) throws QueryNodeParseException {
      ReInit(new StringReader(query.toString()));
      try {
        // TopLevelQuery is a Query followed by the end-of-input (EOF)
        QueryNode querynode = TopLevelQuery(field);
        return querynode;
      }
      catch (ParseException tme) {
            tme.setQuery(query);
            throw tme;
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryParser.core.nodes.QueryNode

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.