當前位置: 首頁>>代碼示例>>Java>>正文


Java BooleanQuery.getMaxClauseCount方法代碼示例

本文整理匯總了Java中org.apache.lucene.search.BooleanQuery.getMaxClauseCount方法的典型用法代碼示例。如果您正苦於以下問題:Java BooleanQuery.getMaxClauseCount方法的具體用法?Java BooleanQuery.getMaxClauseCount怎麽用?Java BooleanQuery.getMaxClauseCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.lucene.search.BooleanQuery的用法示例。


在下文中一共展示了BooleanQuery.getMaxClauseCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: build

import org.apache.lucene.search.BooleanQuery; //導入方法依賴的package包/類
@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;

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:36,代碼來源:StandardBooleanQueryNodeBuilder.java

示例2: build

import org.apache.lucene.search.BooleanQuery; //導入方法依賴的package包/類
@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;

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:37,代碼來源:BooleanQueryNodeBuilder.java


注:本文中的org.apache.lucene.search.BooleanQuery.getMaxClauseCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。