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

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


   * @throws QueryNodeException
   *           if something wrong happens along the three phases
   */
  public Object parse(String query, String defaultField)
      throws QueryNodeException {
    QueryNode queryTree = getSyntaxParser().parse(query, defaultField);

    QueryNodeProcessor processor = getQueryNodeProcessor();

    if (processor != null) {
      queryTree = processor.process(queryTree);
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

    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 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

    throw new Error("Missing return statement in function");
  }

// This makes sure that there is no garbage after the query string
  final public QueryNode TopLevelQuery(CharSequence field) throws ParseException {
        QueryNode q;
    q = Query(field);
    jj_consume_token(0);
                {if (true) return q;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

//   DisjQuery ::= ConjQuery ( OR ConjQuery )*
//   ConjQuery ::= Clause ( AND Clause )*
//      Clause ::= [ Modifier ] ...
  final public QueryNode Query(CharSequence field) throws ParseException {
  Vector clauses = null;
  QueryNode c, first=null;
    first = DisjQuery(field);
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOT:
View Full Code Here

        }
    throw new Error("Missing return statement in function");
  }

  final public QueryNode DisjQuery(CharSequence field) throws ParseException {
        QueryNode first, c;
        Vector clauses = null;
    first = ConjQuery(field);
    label_2:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
View Full Code Here

    }
    throw new Error("Missing return statement in function");
  }

  final public QueryNode ConjQuery(CharSequence field) throws ParseException {
        QueryNode first, c;
        Vector clauses = null;
    first = ModClause(field);
    label_3:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
View Full Code Here

//       return new BooleanQueryNode(clauses);
//       }
//     }
// }
  final public QueryNode ModClause(CharSequence field) throws ParseException {
  QueryNode q;
  ModifierQueryNode.Modifier mods;
    mods = Modifiers();
    q = Clause(field);
                if (mods != ModifierQueryNode.Modifier.MOD_NONE) {
                        q = new ModifierQueryNode(q, mods);
View Full Code Here

                {if (true) return q;}
    throw new Error("Missing return statement in function");
  }

  final public QueryNode Clause(CharSequence field) throws ParseException {
  QueryNode q;
  Token fieldToken=null, boost=null;
  boolean group = false;
    if (jj_2_1(2)) {
      fieldToken = jj_consume_token(TERM);
      jj_consume_token(COLON);
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.