blob: 63b5eb3f8f51db032509664a0053d26c84ec87f3 [file] [log] [blame]
= Solr Configuration Files
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
Solr has several configuration files that you will interact with during your implementation.
Many of these files are in XML format, although APIs that interact with configuration settings tend to accept JSON for programmatic access as needed.
== Solr Home
When Solr runs, it needs access to a home directory.
When you first install Solr, your home directory is `server/solr`.
However, some examples may change this location (such as, if you run `bin/solr start -e cloud`, your home directory will be `example/cloud`).
The home directory contains important configuration information and is the place where Solr will store its index.
The layout of the home directory will look a little different when you are running Solr in a user-managed cluster or single-node installation vs. when you are running a SolrCloud cluster.
The crucial parts of the Solr home directory are shown in these examples:
.User-Managed Cluster or Single-Node
[source,plain]
----
<solr-home-directory>/
solr.xml
core_name1/
core.properties
conf/
solrconfig.xml
managed-schema.xml
data/
core_name2/
core.properties
conf/
solrconfig.xml
managed-schema.xml
data/
----
.SolrCloud
[source,plain]
----
<solr-home-directory>/
solr.xml
core_name1/
core.properties
data/
core_name2/
core.properties
data/
----
You may see other files, but the main ones you need to know are discussed below.
== Solr's Configuration Files
Inside Solr's Home, you'll find these files:
* `solr.xml` specifies configuration options for your Solr server instance.
For more information on `solr.xml` see xref:configuring-solr-xml.adoc[].
* Per Solr Core:
** `core.properties` defines specific properties for each core such as its name, the collection the core belongs to, the location of the schema, and other parameters.
For more details on `core.properties`, see the section xref:core-discovery.adoc[].
** `solrconfig.xml` controls high-level behavior.
You can, for example, specify an alternate location for the data directory.
For more information on `solrconfig.xml`, see xref:configuring-solrconfig-xml.adoc[].
** `managed-schema.xml` or `schema.xml` describes the documents you will ask Solr to index.
The schema defines a document as a collection of fields.
You can define both the field types and the fields themselves.
Field type definitions are powerful and include information about how Solr processes incoming field values and query values.
For more information on Solr schemas, see xref:indexing-guide:schema-elements.adoc[].
** `data/` contains index files.
Note that the SolrCloud example does not include a `conf` directory for each Solr Core (so there is no `solrconfig.xml` or schema file).
This is because the configuration files usually found in the `conf` directory are stored in ZooKeeper so they can be propagated across the cluster.
If you are using SolrCloud with the embedded ZooKeeper instance, you may also see `zoo.cfg` and `zoo.data` which are ZooKeeper configuration and data files.
However, if you are running your own ZooKeeper ensemble, you would supply your own ZooKeeper configuration file when you start it and the copies in Solr would be unused.
== Files Screen
The Files screen in the Admin UI lets you browse & view configuration files (such as `solrconfig.xml` and the schema file) for the collection you selected.
.The Files Screen
image::configuration-files/files-screen.png[Files screen,height=400]
If you are using xref:deployment-guide:cluster-types.adoc#solrcloud-mode[SolrCloud], the files displayed are the configuration files for this collection stored in ZooKeeper.
In user-managed clusters or single-node installations, all files in the `conf` directory are displayed.
The configuration files shown may or may not be used by the collection as use of the file depends on how they are referenced in either `solrconfig.xml` or your schema.
Configuration files cannot be edited with this screen, so a text editor of some kind must be used.
This screen is related to the xref:indexing-guide:schema-browser-screen.adoc[], in that they both can display information from the schema.
However, the Schema Browser provides a way to drill into the analysis chain and displays linkages between field types, fields, and dynamic field rules.