Package org.apache.solr.core

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


        //would be affected by the issue stated at
        //http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201301.mbox/%3CB7B8B36F1A0BE24F842758C318E56E925EB334%40EXCHDB2.na1.ad.group%3E
        //while this was introduced with 4.1 this only affects this code with 4.4
        //as with an API change the methods implicitly calling load() where
        //removed.
        coreContainer.load();
        CoreDescriptor coreDescriptor = new CoreDescriptor(coreContainer, coreId,
                solrCoreFolder.getAbsolutePath());
        SolrCore core = coreContainer.create(coreDescriptor);
//        coreContainer.createAndLoad(solrHome, configFile)load();
        coreContainer.register(coreId, core, true);
View Full Code Here


        // Open up the Solr index, and do some searches.
        System.setProperty("solr.data.dir", out + "/part-00000");

        CoreContainer coreContainer = new CoreContainer(SOLR_HOME_DIR);
        coreContainer.load();
        SolrServer solrServer = new EmbeddedSolrServer(coreContainer, "");

        ModifiableSolrParams params = new ModifiableSolrParams();
        params.set(CommonParams.Q, "turbowriter");
View Full Code Here

        System.setProperty("enable.cache-warming", "false"); // We certainly don't need to warm the cache
       
        CoreContainer coreContainer = new CoreContainer(tmpSolrHome.getAbsolutePath());
       
        try {
            coreContainer.load();
            Collection<SolrCore> cores = coreContainer.getCores();
            SolrCore core = null;
           
            if (cores.size() == 0) {
                throw new TapException("No Solr cores are available");
View Full Code Here

        try {
            log.info(">> +++++++++++++++++++++++");
            XPathFactory.newInstance();
            log.info(">>  {}",org.xml.sax.InputSource.class.getClassLoader());
            log.info(">> +++++++++++++++++++++++");
            container.load(solrDir.getAbsolutePath(), solrCof);
        } finally {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        this.server = container;
        this.registrations = Collections.synchronizedMap(
View Full Code Here

        throw new MorphlineRuntimeException(e);
      }
    } else {
      if (solrUrl == null && solrHomeDir != null) {
        CoreContainer coreContainer = new CoreContainer(solrHomeDir);
        coreContainer.load();
        EmbeddedSolrServer embeddedSolrServer = new EmbeddedSolrServer(coreContainer, collectionName);
        return embeddedSolrServer;
      }
      if (solrUrl == null || solrUrl.length() == 0) {
        throw new MorphlineCompilationException("Missing parameter 'solrUrl'", config);
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

             */
              
               File h = new File(home);
                 File f = new File( h, "solr.xml" );
                 CoreContainer container = new CoreContainer(home);
                 container.load( home, f );
                 server = new EmbeddedSolrServer( container, this.coreName );
             }
            
             if (server==null) return false;

View Full Code Here

    System.setProperty("solr.hdfs.blockcache.enabled", "false");
    System.setProperty("solr.autoCommit.maxTime", "600000");
    System.setProperty("solr.autoSoftCommit.maxTime", "-1");
   
    CoreContainer container = new CoreContainer(loader);
    container.load();
   
    Properties props = new Properties();
    props.setProperty(CoreDescriptor.CORE_DATADIR, dataDirStr);
   
    CoreDescriptor descr = new CoreDescriptor(container, "core1",
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

                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

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.