Search in sources :

Example 6 with AlfrescoCoreAdminHandler

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

Example 7 with AlfrescoCoreAdminHandler

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

Example 8 with AlfrescoCoreAdminHandler

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);
    }
}
Also used : SolrInputDocument(org.apache.solr.common.SolrInputDocument) TenantAclIdDbId(org.alfresco.solr.AlfrescoSolrDataModel.TenantAclIdDbId) CoreContainer(org.apache.solr.core.CoreContainer) AlfrescoCoreAdminHandler(org.alfresco.solr.AlfrescoCoreAdminHandler) SolrContentStore(org.alfresco.solr.content.SolrContentStore) IOException(java.io.IOException) SolrInformationServer(org.alfresco.solr.SolrInformationServer)

Example 9 with AlfrescoCoreAdminHandler

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

Aggregations

AlfrescoCoreAdminHandler (org.alfresco.solr.AlfrescoCoreAdminHandler)9 CoreContainer (org.apache.solr.core.CoreContainer)6 SolrInformationServer (org.alfresco.solr.SolrInformationServer)5 TenantAclIdDbId (org.alfresco.solr.AlfrescoSolrDataModel.TenantAclIdDbId)3 SolrContentStore (org.alfresco.solr.content.SolrContentStore)3 SolrInputDocument (org.apache.solr.common.SolrInputDocument)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)1 AlfrescoSolrUtils.getAcl (org.alfresco.solr.AlfrescoSolrUtils.getAcl)1 AlfrescoSolrUtils.getAclChangeSet (org.alfresco.solr.AlfrescoSolrUtils.getAclChangeSet)1 AlfrescoSolrUtils.getAclReaders (org.alfresco.solr.AlfrescoSolrUtils.getAclReaders)1 AlfrescoSolrUtils.getNode (org.alfresco.solr.AlfrescoSolrUtils.getNode)1 AlfrescoSolrUtils.getNodeMetaData (org.alfresco.solr.AlfrescoSolrUtils.getNodeMetaData)1 AlfrescoSolrUtils.getTransaction (org.alfresco.solr.AlfrescoSolrUtils.getTransaction)1 AlfrescoSolrUtils.indexAclChangeSet (org.alfresco.solr.AlfrescoSolrUtils.indexAclChangeSet)1 TrackerState (org.alfresco.solr.TrackerState)1 Acl (org.alfresco.solr.client.Acl)1 AclChangeSet (org.alfresco.solr.client.AclChangeSet)1 AclReaders (org.alfresco.solr.client.AclReaders)1 Node (org.alfresco.solr.client.Node)1