当前位置: 首页>>代码示例>>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;未经允许,请勿转载。