FactorPad
Faster Learning Tutorials

The Solr help command syntax and examples

The solr script is used to administer Solr at the command line and help offers command syntax and options.
  1. About - understand the purpose of the help command.
  2. Syntax - see 2 ways to access help on the Solr script at the command line.
  3. Options - view 10 ways to find help and syntax on Solr commands.
  4. Examples - review examples of output from help.
by Paul Alan Davis, CFA, October 12, 2017
Updated: July 15, 2018
Here we focus on the command line using a Linux-based operating system, however many of the same commands work for macOS. There are slight differences for Windows.

Outline Back Next

~/ home  / tech  / solr  / reference  / solr help


The solr help Command

Beginner

The first place to start when learning syntax and the purpose of commands within the Solr script is by appending help or -help after the command. See below for more information.

Apache Solr Reference

1. About the solr help command

The solr help command has two purposes. It can be used to find general help on the solr script itself and also to find usage, syntax and options for each of the commands within the solr script. There are 12 commands within the solr script; however, you can access help for 10 of the 12 commands.

2. Syntax for the solr help command

There are two ways to find help with the solr script for general help and for command-specific help. This assumes your current working directory is the $SOLR_HOME directory for Solr, which for version 7 would be in ~/solr-7.0.0 in standalone mode for a local installation. When running in a production environment the directory locations may differ.

So the path to the location of the solr script is: ~/solr-7.0.0/bin/solr. Alternatively, the solr script can be run using the convention ./solr from within the bin directory.

When using a Solr Windows installation the solr script is called using solr.cmd.

General help

To find general help on the bin/solr script, including a list of the 12 commands, append help after a space from the HOME directory.

$ bin/solr help

Output from this general help lists all 12 commands. (The * notes where command-specific help is not available).

  1. start
  2. stop
  3. restart
  4. status*
  5. healthcheck
  6. create
  7. create_core
  8. create_collection
  9. delete
  10. version*
  11. zk
  12. auth
Command-specific help

To find command-specific help append -help after the command name.

$ bin/solr COMMAND -help

Where COMMAND is one of 10 commands. See below.

3. Options for the solr help command

For each of the following 10 commands within the bin/solr script append -help after each command. The bin/solr status and bin/solr version commands do not provide help.

Syntax Purpose
bin/solr start -help Start Solr with settings such as foreground or background, cloud or standalone mode, ports, directories, example data sets and memory allocations.
bin/solr stop -help Stop Solr instances by key, port or all.
bin/solr restart -help Restart Solr with settings similar to the start command.
bin/solr healthcheck -help Report health measures on collections or hosts.
bin/solr create -help Create a core in standalone mode or a collection in SolrCloud mode with settings for name, directory, configurations, shards, replication and ports.
bin/solr create_core -help Create a core in standalone mode with settings for naming the core, configurations and ports.
bin/solr create_collection -help Create a collection in SolrCloud mode with settings for naming the collection and setting configurations, shards, replicas and ports.
bin/solr delete -help Delete a core or collection with settings for configurations and ports.
bin/solr zk -help Manage the zookeeper with options for copying, removing, moving, listing and creating directories and managing nodes.
bin/solr auth -help Set the authentication type to use basic authentication or Kerberos including configurations and prompts.

4. Examples of the solr help command

Example 1 - Print general help

To print syntax and help for the bin/solr command append help without a dash.

$ bin/solr help Usage: solr COMMAND OPTIONS where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk, auth Standalone server example (start Solr running in the background on port 8984): ./solr start -p 8984 SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options enabled): ./solr start -c -m 1g -z localhost:2181 -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044" Pass -help after any COMMAND to see command-specific usage information, such as: ./solr start -help or ./solr stop -help

Under Usage is the syntax for entering commands using solr COMMAND OPTIONS format.

Example 2 - Print command-specific help on the stop command

To print options for the bin/solr stop command append -help.

$ bin/solr stop -help Usage: solr stop [-k key] [-p port] [-V] -k <key> Stop key; default is solrrocks -p <port> Specify the port the Solr HTTP listener is bound to -all Find and stop all running Solr servers on this host
Example 3 - Print command-specific help on the healthcheck command

To print help and syntax for the bin/solr healthcheck command append -help.

$ bin/solr healthcheck -help Usage: solr healthcheck [-c collection] [-z zkHost] -c <collection> Collection to run healthcheck against. -z <zkHost> Zookeeper connection string; default is localhost:9983

Other Related Solr Content

FactorPad offers Apache Solr Search content in both tutorials and reference.


What's Next?

Subscribe here for more free learning content on our YouTube Channel.

  • To see the outline of this Solr reference, click Outline.
  • To learn more about the Solr Reference, click Back.
  • To learn about how to start Solr, click Next.

Outline Back Next

~/ home  / tech  / solr  / reference  / solr help



 
 
Keywords:
solr reference
apache solr
solr search
website search
enterprise search
apache lucene
lucene reference
solr examples
solr commands
solr syntax
solr help
solr wiki
solr settings
solr configuration
man page