Java 类org.apache.lucene.search.BooleanQuery.TooManyClauses 实例源码

项目:vertigo-labs    文件:LuceneIndexPlugin.java   
private List<Person> executeQuery(final LuceneIndex<Person> luceneDb, final Query query, final int maxRow) throws IOException, InvalidTokenOffsetsException {
    try (final IndexReader indexReader = luceneDb.createIndexReader()) {
        final IndexSearcher searcher = new IndexSearcher(indexReader);
        //1. Exécution des la Requête
        final TopDocs topDocs = searcher.search(query, null, maxRow);

        //2. Traduction du résultat Lucene en une Collection
        return translateDocs(luceneDb, searcher, topDocs, query);
    } catch (final TooManyClauses e) {
        throw new RuntimeException("Too many clauses", e);
    }
}
项目:Genji    文件:LuceneSearcherTest.java   
@Test
public void test() throws TooManyClauses, ParseException {
    assertNotNull(LuceneSearcher.getLookupFieldSearchers());
}
项目:lams    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:lams    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:lams    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:search    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:search    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:search    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:NYBC    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:NYBC    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:NYBC    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:read-open-source-code    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:read-open-source-code    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:read-open-source-code    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:read-open-source-code    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:Maskana-Gestor-de-Conocimiento    文件:StandardBooleanQueryNodeBuilder.java   
@Override
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);

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));
        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}
项目:Maskana-Gestor-de-Conocimiento    文件:AnyQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  AnyQueryNode andNode = (AnyQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, BooleanClause.Occur.SHOULD);
        } catch (TooManyClauses ex) {

          throw new QueryNodeException(new MessageImpl(
          /*
           * IQQQ.Q0028E_TOO_MANY_BOOLEAN_CLAUSES,
           * BooleanQuery.getMaxClauseCount()
           */QueryParserMessages.EMPTY_MESSAGE), ex);

        }

      }

    }

  }

  bQuery.setMinimumNumberShouldMatch(andNode.getMinimumMatchingElements());

  return bQuery;

}
项目:Maskana-Gestor-de-Conocimiento    文件:BooleanQueryNodeBuilder.java   
@Override
public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {
  BooleanQueryNode booleanNode = (BooleanQueryNode) queryNode;

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

  if (children != null) {

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

      if (obj != null) {
        Query query = (Query) obj;

        try {
          bQuery.add(query, getModifierValue(child));

        } catch (TooManyClauses ex) {

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

        }

      }

    }

  }

  return bQuery;

}