Package org.apache.solr.core

Examples of org.apache.solr.core.CoreDescriptor


            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


  public EmbeddedSolrServer( SolrCore core )
  {
    if ( core == null ) {
      throw new NullPointerException("SolrCore instance required");
    }
    CoreDescriptor dcore = core.getCoreDescriptor();
    if (dcore == null)
      throw new NullPointerException("CoreDescriptor required");
   
    CoreContainer cores = dcore.getCoreContainer();
    if (cores == null)
      throw new NullPointerException("CoreContainer required");
   
    coreName = dcore.getName();
    coreContainer = cores;
    _parser = new SolrRequestParsers( null );
  }
View Full Code Here

   
    // Initialize
    try {
      CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir));
      SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
      CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir());
      IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null);
      core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);
      cores.register("", core, false);
      parser = new SolrRequestParsers( solrConfig );
    }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();

    SolrResourceLoader loader = new SolrResourceLoader(getSolrHome());
    CoreContainer container = new CoreContainer(loader);
    CoreDescriptor descriptor = new CoreDescriptor(container, "cname", ".");
    SolrCore core = container.create(descriptor);
    container.register(core.getName(), core, false);

    solr = new EmbeddedSolrServer(container, core.getName());
  }
View Full Code Here

  {
    super.setUp();
   
    SolrResourceLoader loader = new SolrResourceLoader( getSolrHome() );
    CoreContainer container = new CoreContainer( loader );
    CoreDescriptor descriptor = new CoreDescriptor(container,
        "cname", "." );
    SolrCore core = container.create(descriptor);
    container.register( core.getName(), core, false );

    solr = new EmbeddedSolrServer(container, core.getName());
View Full Code Here

      return coreName;
    }
    @Override
    public CoreContainer initialize() {
      CoreContainer container = new CoreContainer(new SolrResourceLoader(SolrResourceLoader.locateSolrHome()));
      CoreDescriptor dcore = new CoreDescriptor(container, coreName, solrConfig.getResourceLoader().getInstanceDir());
      dcore.setConfigName(solrConfig.getResourceName());
      dcore.setSchemaName(indexSchema.getResourceName());
      SolrCore core = new SolrCore( null, dataDirectory, solrConfig, indexSchema, dcore);
      container.register(coreName, core, false);
      return container;
    }
View Full Code Here

  public EmbeddedSolrServer( SolrCore core )
  {
    if ( core == null ) {
      throw new NullPointerException("SolrCore instance required");
    }
    CoreDescriptor dcore = core.getCoreDescriptor();
    if (dcore == null)
      throw new NullPointerException("CoreDescriptor required");
   
    CoreContainer cores = dcore.getCoreContainer();
    if (cores == null)
      throw new NullPointerException("CoreContainer required");
   
    coreName = dcore.getName();
    coreContainer = cores;
    _parser = new SolrRequestParsers( null );
  }
View Full Code Here

   
    // Initialize
    try {
      CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir));
      SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
      CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir());
      IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null);
      core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);
      cores.register("", core, false);
      parser = new SolrRequestParsers( solrConfig );
    }
View Full Code Here

  public EmbeddedSolrServer( SolrCore core )
  {
    if ( core == null ) {
      throw new NullPointerException("SolrCore instance required");
    }
    CoreDescriptor dcore = core.getCoreDescriptor();
    if (dcore == null)
      throw new NullPointerException("CoreDescriptor required");
   
    CoreContainer cores = dcore.getCoreContainer();
    if (cores == null)
      throw new NullPointerException("CoreContainer required");
   
    coreName = dcore.getName();
    coreContainer = cores;
    _parser = new SolrRequestParsers( null );
  }
View Full Code Here

    String cname = params.get( CoreAdminParams.CORE );
   
    switch(action) {
      case CREATE: {
        String name = params.get(CoreAdminParams.NAME);
        CoreDescriptor dcore = new CoreDescriptor(cores, name, params.get(CoreAdminParams.INSTANCE_DIR));

        // fillup optional parameters
        String opts = params.get(CoreAdminParams.CONFIG);
        if (opts != null)
          dcore.setConfigName(opts);

        opts = params.get(CoreAdminParams.SCHEMA);
        if (opts != null)
          dcore.setSchemaName(opts);

        SolrCore core = cores.create(dcore);
        cores.register(name, core,false);
        rsp.add("core", core.getName());
        do_persist = cores.isPersistent();
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.