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


Java SolrCore.close方法代碼示例

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


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

示例1: inflateSolrSchema

import org.apache.solr.core.SolrCore; //導入方法依賴的package包/類
@Override
public void inflateSolrSchema()
{
    server = solr.solrServer();
    SolrCore solrCore = solr.solrCore();
    try
    {
        indexedFields = solrCore.getSchema().getFields();
    }
    finally
    {
        solrCore.close();
    }
}
 
開發者ID:apache,項目名稱:polygene-java,代碼行數:15,代碼來源:SolrEntityIndexerMixin.java

示例2: getCore

import org.apache.solr.core.SolrCore; //導入方法依賴的package包/類
/** Gets a core that does not have it's refcount incremented (i.e. there is no need to
 * close when done).  This is not MT safe in conjunction with reloads!
 */
public SolrCore getCore() {
  // get the core & decrease its refcount:
  // the container holds the core for the harness lifetime
  SolrCore core = container.getCore(coreName);
  if (core != null)
    core.close();
  return core;
}
 
開發者ID:europeana,項目名稱:search,代碼行數:12,代碼來源:TestHarness.java

示例3: createParser

import org.apache.solr.core.SolrCore; //導入方法依賴的package包/類
@Override
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
  return new QParser(qstr, localParams, params, req) {
    @Override
    public Query parse() throws SyntaxError {
      String fromField = getParam("from");
      String fromIndex = getParam("fromIndex");
      String toField = getParam("to");
      String v = localParams.get("v");
      Query fromQuery;
      long fromCoreOpenTime = 0;

      if (fromIndex != null && !fromIndex.equals(req.getCore().getCoreDescriptor().getName()) ) {
        CoreContainer container = req.getCore().getCoreDescriptor().getCoreContainer();

        final SolrCore fromCore = container.getCore(fromIndex);
        RefCounted<SolrIndexSearcher> fromHolder = null;

        if (fromCore == null) {
          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cross-core join: no such core " + fromIndex);
        }

        LocalSolrQueryRequest otherReq = new LocalSolrQueryRequest(fromCore, params);
        try {
          QParser parser = QParser.getParser(v, "lucene", otherReq);
          fromQuery = parser.getQuery();
          fromHolder = fromCore.getRegisteredSearcher();
          if (fromHolder != null) fromCoreOpenTime = fromHolder.get().getOpenTime();
        } finally {
          otherReq.close();
          fromCore.close();
          if (fromHolder != null) fromHolder.decref();
        }
      } else {
        QParser fromQueryParser = subQuery(v, null);
        fromQuery = fromQueryParser.getQuery();
      }

      JoinQuery jq = new JoinQuery(fromField, toField, fromIndex, fromQuery);
      jq.fromCoreOpenTime = fromCoreOpenTime;
      return jq;
    }
  };
}
 
開發者ID:europeana,項目名稱:search,代碼行數:45,代碼來源:JoinQParserPlugin.java


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