本文整理汇总了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();
}
}
示例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;
}
示例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;
}
};
}