Package org.apache.lucene.queryparser.flexible.standard.parser

Examples of org.apache.lucene.queryparser.flexible.standard.parser.EscapeQuerySyntaxImpl


  @Override
  protected QueryNode postProcessNode(final QueryNode node) throws QueryNodeException {

    if (node instanceof WildcardQueryNode) {
      throw new QueryNodeException(new MessageImpl("Wildcard not allowed", node
              .toQueryString(new EscapeQuerySyntaxImpl())));
    }


    if (node instanceof FuzzyQueryNode) {
      throw new QueryNodeException(new MessageImpl("Fuzzy not allowed", node
              .toQueryString(new EscapeQuerySyntaxImpl())));
    }

    return node;

  }
View Full Code Here


  @Override
  protected QueryNode preProcessNode(final QueryNode node)
  throws QueryNodeException {
    if (node instanceof SlopQueryNode && ((SlopQueryNode) node).getValue() != 0) {
      throw new QueryNodeException(new MessageImpl("Slop queries are not supported",
        node.toQueryString(new EscapeQuerySyntaxImpl())));
    } else if (node instanceof MultiPhraseQueryNode) {
      throw new QueryNodeException(new MessageImpl("Multi phrase queries are not supported",
        node.toQueryString(new EscapeQuerySyntaxImpl())));
    } else if (node instanceof MatchAllDocsQueryNodeBuilder) {
      throw new QueryNodeException(new MessageImpl("MatchAllDocsQueries are not supported",
        node.toQueryString(new EscapeQuerySyntaxImpl())));
    }
    return node;
  }
View Full Code Here

  throws QueryNodeException {
    if (node instanceof TwigQueryNode) {
      if (this.getQueryConfigHandler().has(KeywordConfigurationKeys.ALLOW_TWIG)) {
        if (!this.getQueryConfigHandler().get(KeywordConfigurationKeys.ALLOW_TWIG)) {
          throw new QueryNodeException(new MessageImpl("TwigQuery not allowed", node
            .toQueryString(new EscapeQuerySyntaxImpl())));
        }
      } else {
        throw new IllegalArgumentException("KeywordConfigurationKeys.ALLOW_TWIG should be set on the KeywordQueryConfigHandler");
      }
    }
View Full Code Here

    }
    catch (final TooManyClauses ex) {
      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES,
          BooleanQuery.getMaxClauseCount(),
          twigNode.toQueryString(new EscapeQuerySyntaxImpl())), ex);
    }

    return query;
  }
View Full Code Here

      }
      catch (final TooManyClauses ex) {
        throw new QueryNodeException(new MessageImpl(
            QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery
                .getMaxClauseCount(), queryNode
                .toQueryString(new EscapeQuerySyntaxImpl())), ex);
      }
    }
    return bQuery;
  }
View Full Code Here

          } catch (final TooManyClauses ex) {

            throw new QueryNodeException(new MessageImpl(
                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery
                    .getMaxClauseCount(), queryNode
                    .toQueryString(new EscapeQuerySyntaxImpl())), ex);

          }

        }
View Full Code Here

    // validates node
    if (!(queryNode instanceof MatchNoDocsQueryNode)) {
      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, queryNode
              .toQueryString(new EscapeQuerySyntaxImpl()), queryNode.getClass()
              .getName()));
    }

    return new NodeBooleanQuery();
  }
View Full Code Here

    if (builder == null) {

      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, node
              .toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
              .getName()));

    }

    Object obj = builder.build(node);
View Full Code Here

    if (builder == null) {

      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, node
              .toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
              .getName()));

    }

    Object obj = builder.build(node);
View Full Code Here

          } catch (TooManyClauses ex) {

            throw new QueryNodeException(new MessageImpl(
                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery
                    .getMaxClauseCount(), queryNode
                    .toQueryString(new EscapeQuerySyntaxImpl())), ex);

          }

        }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryparser.flexible.standard.parser.EscapeQuerySyntaxImpl

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.