Package org.apache.solr.core

Examples of org.apache.solr.core.CoreDescriptor


    container.load();
   
    Properties props = new Properties();
    props.setProperty(CoreDescriptor.CORE_DATADIR, dataDirStr);
   
    CoreDescriptor descr = new CoreDescriptor(container, "core1",
        solrHomeDir.toString());
   
    descr.setDataDir(dataDirStr);
    descr.setCoreProperties(props);
    SolrCore core = container.create(descr);
   
    if (!(core.getDirectoryFactory() instanceof HdfsDirectoryFactory)) {
      throw new UnsupportedOperationException(
          "Invalid configuration. Currently, the only DirectoryFactory supported is "
View Full Code Here


        @Override
        public void preClose(SolrCore core) {}

        @Override
        public void postClose(SolrCore core) {
          CoreDescriptor cd = core.getCoreDescriptor();
          if (cd != null) {
            File dataDir = new File(cd.getInstanceDir() + File.separator + "data");
            try {
              FileUtils.deleteDirectory(dataDir);
            } catch (IOException e) {
              e.printStackTrace();
            }
View Full Code Here

        if(!coreDir.isDirectory()){
            throw new IllegalArgumentException("The Core Directory '"+
                coreDir+" for the Core '"+coreName+"' does not exist or is not an directory");
        }
        SolrCore core;
        CoreDescriptor coreDescriptor = new CoreDescriptor(server,
            coreName, coreDir.getAbsolutePath());
        try {
            core = server.create(coreDescriptor);
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Unable to configure XML parser for parsing" +
View Full Code Here

        String coreDataDir = new File(dataDir, coreName).getAbsolutePath();
        coreDefs.put(coreName, coreDataDir);
        // default data dir
        properties.setProperty(CoreDescriptor.CORE_DATADIR, coreDataDir);

        return super.create(new CoreDescriptor(coreDescriptor.getCoreContainer(), coreDescriptor
            .getName(), coreDescriptor.getInstanceDir(), properties));
      }
    };
    // Initialize cores
    cores.load();
View Full Code Here

            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());

            solrCore = new SolrCore(null, solrConfig.getDataDir(),
                    solrConfig, schema, descriptor);
            solrContainer.register("", solrCore, false);
            return new EmbeddedSolrServer(solrContainer, "");
View Full Code Here

        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());

        SolrCore solrCore = new SolrCore(null, solrConfig.getDataDir(),
                solrConfig, schema, descriptor);
        solrContainer.register("", solrCore, false);
        return new EmbeddedSolrServer(solrContainer, "");
View Full Code Here

TOP

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

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.