Till now we have gone through the introduction of Solr, the architecture of Solr, installation and setup of Solr, its folder structure, and the basics of the search engine. Now In this tutorial, we will go through some basic commands of the Apache Solr.
Let us see some basic commands used in Apache Solr.
1. Starting Solr
We can start Apache Solr using the below command. By default, Apache Solr starts at 8983 port.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr startOutput:
In case if you are receiving this message "Solr home directory /home/cloudduggu/hadoop/solr-8.8.1 must contain a solr.xml file!" then copy ther "solr.xml" file from "solr-8.8.1/server/solr" location to Solr home "solr-8.8.1" and then try to start Solr.
2. Stopping Solr
We can use the below command to stop the Apache Solr.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr stopOutput:
3. Starting Solr on other Port
We can start Apache Solr on other port as well using "-P" and the port number.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr start -p 8982Output:
4. Solr Status
We can check the status of Apache Solr using the "status" command.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr statusOutput:
5. Solr Restart
Using the restart option, we can restart the Apache Solr.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr restartOutput:
6. Solr Version
The version option of Apache Solr displays the current version of Solr.
Command:
cloudduggu@ubuntu:~/hadoop/solr-8.8.1$ ./bin/solr versionOutput:
7. Solr Help
The help option is used to provide the detail about the commands and the usage of those commands.