Package org.apache.solr.core

Examples of org.apache.solr.core.CoreContainer


  public void runFixtures() {
    Environment env = applicationContext.getEnvironment();
    boolean runFixtures = env.getProperty(SOLR_FIXTURES, boolean.class, true);
    if (runFixtures) {
      Map<String, SolrServer> servers = applicationContext.getBeansOfType(SolrServer.class);
      CoreContainer cores = applicationContext.getBean(CoreContainer.class);
      String solrHome = cores.getSolrHome();

      boolean async = env.getProperty(SOLR_FIXTURES_ASYNC, boolean.class, true);

      for (Entry<String, SolrServer> server : servers.entrySet()) {
        String coreName = server.getKey();
View Full Code Here


  
    @Override
    public CoreContainer initialize() throws IOException, ParserConfigurationException, SAXException {
                     
        CoreContainer cores = new SolandraCoreContainer(solrConfigFilename == null ? SolrConfig.DEFAULT_CONF_FILE : solrConfigFilename);
            
        //Startup cassandra
        if(System.getProperty("solandra.clientmode", "false").equalsIgnoreCase("true"))
            CassandraUtils.startupClient();
        else
View Full Code Here

                return httpSolrServer;
            } else {
                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());

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

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

        File dataDir = new File(homeDir, "data");
        String homeDirPath = homeDir.getCanonicalPath();
        String dataDirPath = dataDir.getCanonicalPath();
        System.setProperty("solr.solr.home", homeDirPath);
        System.setProperty("solr.data.dir", dataDirPath);
        coreContainer = new CoreContainer();
        coreContainer.load(homeDirPath, solrFile);
       
        server = new EmbeddedSolrServer(coreContainer, "js");
        server.deleteByQuery("*:*");
        server.commit();
View Full Code Here

        File dataDir = new File(homeDir, "data");
        String homeDirPath = homeDir.getCanonicalPath();
        String dataDirPath = dataDir.getCanonicalPath();
        System.setProperty("solr.solr.home", homeDirPath);
        System.setProperty("solr.data.dir", dataDirPath);
        coreContainer = new CoreContainer();
        coreContainer.load(homeDirPath, solrFile);
       
        server = new EmbeddedSolrServer(coreContainer, "js");
        server.deleteByQuery("*:*");
        server.commit();
View Full Code Here

    private EmbeddedSolrServer startSolr(String home) throws Exception {
        try {
            SolrConfig solrConfig = new SolrConfig(home, SOLR_CONFIG, null);
            IndexSchema schema = new IndexSchema(solrConfig, SOLR_SCHEMA, null);

            solrContainer = new CoreContainer(new SolrResourceLoader(
                    SolrResourceLoader.locateSolrHome()));
            CoreDescriptor descriptor = new CoreDescriptor(solrContainer, "",
                    solrConfig.getResourceLoader().getInstanceDir());
            descriptor.setConfigName(solrConfig.getResourceName());
            descriptor.setSchemaName(schema.getResourceName());
View Full Code Here

     */
    private EmbeddedSolrServer startSolr(String home) throws Exception {
        SolrConfig solrConfig = new SolrConfig(home, SOLR_CONFIG, null);
        IndexSchema schema = new IndexSchema(solrConfig, SOLR_SCHEMA, null);

        solrContainer = new CoreContainer(new SolrResourceLoader(
                SolrResourceLoader.locateSolrHome()));
        CoreDescriptor descriptor = new CoreDescriptor(solrContainer, "",
                solrConfig.getResourceLoader().getInstanceDir());
        descriptor.setConfigName(solrConfig.getResourceName());
        descriptor.setSchemaName(schema.getResourceName());
View Full Code Here

TOP

Related Classes of org.apache.solr.core.CoreContainer

Copyright © 2018 www.massapicom. 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.