本文整理匯總了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;
}
};
}