Search in sources :

Example 6 with SolrInformationServer

use of org.alfresco.solr.SolrInformationServer 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;
}
Also used : CoreContainer(org.apache.solr.core.CoreContainer) AlfrescoCoreAdminHandler(org.alfresco.solr.AlfrescoCoreAdminHandler) SolrInformationServer(org.alfresco.solr.SolrInformationServer)

Aggregations

SolrInformationServer (org.alfresco.solr.SolrInformationServer)6 AlfrescoCoreAdminHandler (org.alfresco.solr.AlfrescoCoreAdminHandler)5 CoreContainer (org.apache.solr.core.CoreContainer)5 SolrContentStore (org.alfresco.solr.content.SolrContentStore)4 TenantAclIdDbId (org.alfresco.solr.AlfrescoSolrDataModel.TenantAclIdDbId)3 SolrInputDocument (org.apache.solr.common.SolrInputDocument)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 SolrKeyResourceLoader (org.alfresco.solr.SolrKeyResourceLoader)1 SOLRAPIClient (org.alfresco.solr.client.SOLRAPIClient)1 SOLRAPIClientFactory (org.alfresco.solr.client.SOLRAPIClientFactory)1 AclTracker (org.alfresco.solr.tracker.AclTracker)1 CascadeTracker (org.alfresco.solr.tracker.CascadeTracker)1 CommitTracker (org.alfresco.solr.tracker.CommitTracker)1 ContentTracker (org.alfresco.solr.tracker.ContentTracker)1 MetadataTracker (org.alfresco.solr.tracker.MetadataTracker)1 ModelTracker (org.alfresco.solr.tracker.ModelTracker)1 SolrTrackerScheduler (org.alfresco.solr.tracker.SolrTrackerScheduler)1 Tracker (org.alfresco.solr.tracker.Tracker)1