Generating Collection Configuration
To start using Solr and indexing data, you must configure a collection to hold the index.
A collection requires the following configuration files:
-
solrconfig.xml
-
schema.xml
- Any additional files referenced in the
xml
files
The solrconfig.xml
file contains all of the Solr settings for a given
collection, and the schema.xml
file specifies the schema that Solr uses when
indexing documents. For more details on how to configure a collection, see http://wiki.apache.org/solr/SchemaXml.
Configuration files for a collection are contained in a directory called an
instance directory. To generate a template instance directory, run
the following
command:
solrctl instancedir --generate $HOME/solr_configs
You can customize a collection by directly editing the solrconfig.xml
and
schema.xml
files created in $HOME/solr_configs/conf
.
After completing the configuration, you can make it available to Solr by running the
following command, which uploads the contents of the instance directory to
ZooKeeper:
solrctl instancedir --create <collection_name> $HOME/solr_configs
Use the
solrctl
utility to verify that your instance directory uploaded
successfully and is available to ZooKeeper. List the uploaded instance directories as
follows:solrctl instancedir --list
For example, if you used the --create
command to create a collection named
weblogs
, the --list
command should return
weblogs
.