Schemaless - Create Solr Core

Apache solr has the ability to run in schemaless mode. This is achieved by combining a set of 3 solr features.

  1. Managed schema: the ability to modify the schema at runtime using the Apache solr API.
  2. Field guessing: the ability of Solr to guess the type of a document field based on the value that it contains.
  3. Automatic schema field addition: the ability to add the correct field type to the schema based on the type determined by the field guessing.

Reference: https://cwiki.apache.org/confluence/display/solr/Schemaless+Mode

 

The syntax for creating a solr core is show below:

  • corename - a name for the core to create
  • configdir_or_set - the path of a config directory or the name of a Config Set to use in creating the core.
  • port - the port the core will be accessible on.
When the -d paramter isn't given solr automatically creates a core in schemaless mode by using the Config Set "data_driven_schema_configs" that comes Solr.
./bin/solr create -c <corename> -d <configdir_or_set> -p <port>

 

There are several ways to create a Apache Solr Core.

Method #1 - command line
#./bin/solr create -c <corename>
./bin/solr create -c hellocore

 

Method #2 - REST API

The solr core may also be created via the Rest API:

Note: Config Sets are explained here. It is really just directory containing solrconfig.xml and other configuration files for creating a core.

 

http://YOUR_HOST:8983/solr/admin/cores?action=CREATE&name=myhellocore&instanceDir=myhellocore&configSet=basic_configs

 

By default the solr core will be created at server/solr within the solr installation.

Cookbook Category: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.