FactorPad
Build a Better Process

The Solr version Command Syntax and Examples

This command prints the version number of the Apache Solr installation and exits.
  1. About - understand the purpose of the version command.
  2. Syntax - see solr version command usage from the command line.
  3. Options - view options and output from the solr version command.
  4. Examples - review several common examples including additional help.
face pic by Paul Alan Davis, CFA
Updated: February 24, 2021
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 Tip Next

/ factorpad.com / tech / solr / reference / solr-version.html


An ad-free and cookie-free website.


The Solr version Command

Beginner

Custom search applications like Apache Solr update frequently as new features are added. When evaluating Apache Solr search versus Elasticsearch in a test environment for example, the main purpose is to evaluate use cases before moving on to production. When testing, most developers download the latest version and operate on one client or server machine.

In a production environment, typically in a distributed search mode like SolrCloud, system compatibilities and an upgrade path become more important. Incompatibilities and bugs can be introduced if not planned for properly, so the differences between versions become more important.

Other custom search offerings from Google Custom Search and Amazon CloudSearch, among others, manage server instances and upgrades so staying on top of changes across versions is less important.

For Solr specifically, Apache releases new versions as often as quarterly, so the solr version command offers a fast way to see which version is installed.

Apache Solr Reference

1. About the solr version command

The solr version command simply reports the version number and exits, returning the user to the command line.

The solr version command is one of 12 commands within the main solr script.

The solr version command itself has no options. If anything is entered after the command Solr returns output as if the solr help command was entered.

2. Syntax for the solr version command

The syntax for running solr version is as follows.

$ bin/solr version

This syntax assumes your current working directory is the $SOLR_HOME directory for Solr, which for version 7 would be ~/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.

If Solr Windows is your preferred environment for custom search, the solr script is called using solr.cmd.

3. Options for the solr version command

The solr version command takes no options (parameters). It simply returns the version of Apache Solr search on the sytstem.

Syntax Purpose Default
bin/solr version Print the version of Solr installed. No options

4. Examples of the solr version command

Example 1 - Report the Solr version

The following command prints the version number and exits.

$ bin/solr version 7.0.0
Example 2 - Find help on the Solr version command

The version command does not have traditional help similar to a man page for other commands. Any text entered after the command will be ignored and Solr will provide an error and show valid Solr syntax as if bin/solr help was entered.

$ bin/solr version -help ERROR: version is not a valid command! (18 lines trimmed)

Other Related Solr Content

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


What's Next?

Subscribe to our YouTube Channel for more free opportunities to learn. Check out @factorpad on Twitter and our no-spam email list for reminders of new content.

Outline Back Tip Next

/ factorpad.com / tech / solr / reference / solr-version.html


solr version
apache solr
solr reference
enterprise search
apache lucene
lucene reference
apache solr search
solr examples
solr commands
solr syntax
solr help
solr wiki
solr settings
solr configuration
custom search
solr man page

A newly-updated free resource. Connect and refer a friend today.