use of org.alfresco.solr.AlfrescoCoreAdminHandler in project SearchServices by Alfresco.
the class SolrCoreLoadListener method newSearcher.
@Override
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher) {
CoreContainer coreContainer = getCore().getCoreContainer();
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
SolrCoreLoadRegistration.registerForCore(coreAdminHandler, coreContainer, getCore(), getCore().getName());
}
use of org.alfresco.solr.AlfrescoCoreAdminHandler in project SearchServices by Alfresco.
the class FingerPrintComponent method getContentStore.
private SolrContentStore getContentStore(SolrQueryRequest req) {
if (req.getSearcher() != null) {
CoreContainer coreContainer = req.getSearcher().getCore().getCoreContainer();
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
SolrInformationServer srv = (SolrInformationServer) coreAdminHandler.getInformationServers().get(req.getSearcher().getCore().getName());
return srv.getSolrContentStore();
}
return null;
}
use of org.alfresco.solr.AlfrescoCoreAdminHandler in project SearchServices by Alfresco.
the class AlfrescoSolrClusteringComponent method getSolrInputDocument.
private SolrInputDocument getSolrInputDocument(Document doc, SolrQueryRequest req) throws IOException {
try {
String id = getFieldValueString(doc, FIELD_SOLR4_ID);
TenantAclIdDbId tenantAndDbId = AlfrescoSolrDataModel.decodeNodeDocumentId(id);
CoreContainer coreContainer = req.getSearcher().getCore().getCoreContainer();
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
SolrInformationServer srv = (SolrInformationServer) coreAdminHandler.getInformationServers().get(req.getSearcher().getCore().getName());
SolrContentStore solrContentStore = srv.getSolrContentStore();
SolrInputDocument sid = solrContentStore.retrieveDocFromSolrContentStore(tenantAndDbId.tenant, tenantAndDbId.dbId);
return sid;
} catch (StringIndexOutOfBoundsException e) {
throw new IOException(e);
}
}
use of org.alfresco.solr.AlfrescoCoreAdminHandler in project SearchServices by Alfresco.
the class Solr4QueryParser method getContentStore.
/**
* Extracts the contentStore from SolrQueryRequest.
* @param req
* @return
*/
private SolrContentStore getContentStore(SolrQueryRequest req) {
if (req.getSearcher() != null) {
CoreContainer coreContainer = req.getSearcher().getCore().getCoreContainer();
AlfrescoCoreAdminHandler coreAdminHandler = (AlfrescoCoreAdminHandler) coreContainer.getMultiCoreHandler();
SolrInformationServer srv = (SolrInformationServer) coreAdminHandler.getInformationServers().get(req.getSearcher().getCore().getName());
return srv.getSolrContentStore();
}
return null;
}
Aggregations