Apache Solr software comes with different directory structures which together to creates a complete Solr package. The folder structure of Apache Solr contains the bin directory for the execution of programs and Solr commands, the contrib directory stores the source for clustering, language detection, and other details for advanced extensions, the Dist directory will have JAR files, the Docs directory contains the Solr tutorials, the examples directory store the default config sets, the Licences directory contains the license for all Solr dependencies.
The following figure represents the directory structure of Apache Solr.
Now let us have a look into some of the important directories and files of Apache Solr.
1. Solr Bin Directory
The bin directory of Apache Solr contains the important scripts which are required to make Solr up and down and perform various operations. The replication script also presents under this directory only. It also stores the solr.in.sh and solr.in.cmd file to send an input parameter. The script namely install_solr_service.sh, oom_solr.sh and the directory init.d is used when there is a requirement to use Solr as a service on Linux/UNIX system.
2. Solr Script
Solr Script directory is used to run various utilities such as starting and stopping the Solr. We can pass different parameters using the Solr script.
3. Solr Contrib
The contrib directory of Solr contains the important contribution modules to perform advanced things that are beyond the Solr core.
4. Solr Dist and Docs
The Solr dist and docs directory contains the important core file of Solr (solr-core.*.jar). It also contains the contribs JAR files. Depending upon the requirement, we can use these JARs and deploy them on the application server. The docs folder has the necessary tutorials on Solr.
5. Solr Example
The example directory of Apache Solr contains the default configured sets and examples. It also contains the Zookeeper data and sample configuration. By default Solr provides the files, films, and example docs sample data and tech products, schemaless, and DIH config sets.
6. Solr Server
This directory of Solr contains the container setup and the instances of Jetty servlet to run Solr. The subdirectories of the Solr server are as below.
- server/contexts: This directory will have the Jetty web application deployment descriptors. Solr web application requires this directory.
- server/etc: The configurations of Jetty are stored in this directory. It also has an SSL Keystore example.
- server/lib: This directory contains the liberties of Jetty and JAR from the other third party can also be stored.
- server/logs: The log files that are generated by Solr are stored in this directory.
- server/solr: In this directory Solr creates the core directories and this is a default directory of Solr that will have a Solr.xml file.
- server/scripts/cloud-scripts: We can use this command-line tool to work with Zookeeper in Solr cloud mode.
- server/solr-webapp: All the files used by Solr are stored in this directory and the file from this directory should not be edited.
- server/solr/configsets: The configuration option which is required to run Solr is stored in this directory.
- server/resources: To configure the Solr loggers the required files should be present under this directory.