Package org.apache.solr.core

Examples of org.apache.solr.core.CoreContainer.load()


    static final String SOLRCONFIG_PATH = "target/test-classes/solr/solr.xml";

    public static SolrServer createSolrServer() {
        CoreContainer coreContainer = new CoreContainer(SOLR_HOME_PATH);
        try {
            coreContainer.load(SOLR_HOME_PATH, new File(SOLRCONFIG_PATH));
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
View Full Code Here


                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());

                CoreContainer coreContainer = new CoreContainer(solrHomePath);
                try {
                    coreContainer.load(solrHomePath, new File(solrConfigPath));
                } finally {
                    Thread.currentThread().setContextClassLoader(classLoader);
                }

                EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, coreName);
View Full Code Here

    static final String SOLRCONFIG_PATH = "target/test-classes/solr/solr.xml";

    public static SolrServer createSolrServer() {
        CoreContainer coreContainer = new CoreContainer(SOLR_HOME_PATH);
        try {
            coreContainer.load(SOLR_HOME_PATH, new File(SOLRCONFIG_PATH));
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
View Full Code Here

                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());

                CoreContainer coreContainer = new CoreContainer(solrHomePath);
                try {
                    coreContainer.load(solrHomePath, new File(solrConfigPath));
                } finally {
                    Thread.currentThread().setContextClassLoader(classLoader);
                }

                EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, coreName);
View Full Code Here

    public static SolrServer createSolrServer() {
        String homePath = SolrServerProvider.class.getResource(SOLR_HOME_PATH).getFile();
        CoreContainer coreContainer = new CoreContainer(homePath);
        try {
            coreContainer.load(homePath, new File(SolrServerProvider.class.getResource(SOLRCONFIG_PATH).getFile()));
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
View Full Code Here

                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());

                CoreContainer coreContainer = new CoreContainer(solrHomePath);
                try {
                    coreContainer.load(solrHomePath, new File(solrConfigPath));
                } finally {
                    Thread.currentThread().setContextClassLoader(classLoader);
                }

                EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, coreName);
View Full Code Here

    }

    public static SolrServer createSolrServer() throws Exception {
        CoreContainer coreContainer = new CoreContainer(SOLR_HOME_PATH);
        coreContainer.load(SOLR_HOME_PATH, new File(SOLRCONFIG_PATH));
        return new EmbeddedSolrServer(coreContainer, "oak");
    }


    public static OakSolrConfiguration getTestConfiguration() {
View Full Code Here

    public static SolrServer createSolrServer() {
        String homePath = SolrServerProvider.class.getResource(SOLR_HOME_PATH).getFile();
        CoreContainer coreContainer = new CoreContainer(homePath);
        try {
            coreContainer.load();
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
View Full Code Here

        serverProperties = parsedServerProperties.clone();
        CoreContainer container = new CoreContainer(solrDir.getAbsolutePath());
        File solrCof = new File(solrDir,parsedServerProperties.getSolrXml());
        ClassLoader classLoader = updateContextClassLoader();
        try {
            container.load(solrDir.getAbsolutePath(), solrCof);
        } finally {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        this.server = container;
        this.registrations = Collections.synchronizedMap(
View Full Code Here

            serverProperties.setServerName(solrDir.getAbsolutePath());
        }
        //now load the cores
        classLoader = updateContextClassLoader();
        try {
            container.load();
            log.info("      - loaded SolrConfig {}",solrCof);
        } finally {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        //add the currently available cores to the properties
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.