You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2024/08/02 21:25:34 UTC
(solr) branch branch_9x updated: SOLR-16824: Replace deprecated single-dash arguments (#2577) (#2614)
This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new aff0d4dfb30 SOLR-16824: Replace deprecated single-dash arguments (#2577) (#2614)
aff0d4dfb30 is described below
commit aff0d4dfb30fb71f4c009aaf21731e86b5b8651c
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Fri Aug 2 17:25:29 2024 -0400
SOLR-16824: Replace deprecated single-dash arguments (#2577) (#2614)
Migrate dash patterns in documentation, various tests, and various user messages generated by tools to reflect the move to --kebab-case and double dashes.
---------
Co-authored-by: Christos Malliaridis <c....@gmail.com>
---
solr/CHANGES.txt | 2 +-
solr/bin/solr.cmd | 8 +++---
.../src/java/org/apache/solr/cli/CreateTool.java | 2 +-
.../src/java/org/apache/solr/cli/PackageTool.java | 7 ++---
.../apache/solr/packagemanager/PackageManager.java | 4 +--
.../src/test/org/apache/solr/cli/AuthToolTest.java | 2 +-
.../org/apache/solr/cli/SolrCLIZkToolsTest.java | 5 ++--
.../org/apache/solr/cli/ZkSubcommandsTest.java | 4 +--
.../hdfs/util/HdfsRecoverLeaseFileSystemUtils.java | 2 +-
solr/packaging/test/test_adminconsole_urls.bats | 2 +-
solr/packaging/test/test_create_collection.bats | 4 +--
solr/packaging/test/test_extraction.bats | 6 ++---
solr/packaging/test/test_packages.bats | 6 ++---
solr/packaging/test/test_post.bats | 4 +--
solr/packaging/test/test_prometheus.bats | 2 +-
solr/packaging/test/test_ssl.bats | 2 +-
solr/packaging/test/test_zk.bats | 2 +-
.../configuration-guide/pages/package-manager.adoc | 10 ++++----
.../deployment-guide/pages/enabling-ssl.adoc | 6 ++---
.../pages/solr-control-script-reference.adoc | 30 +++++++++++-----------
.../pages/taking-solr-to-production.adoc | 2 +-
.../pages/zookeeper-utilities.adoc | 2 +-
.../getting-started/pages/tutorial-films.adoc | 2 +-
.../indexing-guide/pages/indexing-with-tika.adoc | 12 ++++-----
.../modules/indexing-guide/pages/post-tool.adoc | 14 +++++-----
.../modules/query-guide/pages/spatial-search.adoc | 4 +--
.../modules/query-guide/pages/tagger-handler.adoc | 4 +--
.../solr/common/cloud/ZkMaintenanceUtils.java | 2 +-
28 files changed, 76 insertions(+), 76 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c7da6b0cf63..e04d1bf9a87 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -58,7 +58,7 @@ Improvements
* SOLR-16824: Adopt Linux standard pattern of -- for long option commands, and make all commands "kebab" formatting. I.e -zkHost is now -zk-host. The old parameters
such as -zkHost continue to be supported in the 9.x line of Solr. -u is now used to specify user credentials everywhere, this only impacts the bin/solr assert
- commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, Jan Høydahl, Jason Gerlowski)
+ commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, janhoy, Jason Gerlowski, Christos Malliaridis)
* SOLR-17346: Synchronise stopwords from snowball with those in Lucene (Alastair Porter via Houston Putman)
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index c9925f089c6..4c916c78eb5 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -246,6 +246,7 @@ set FIRST_ARG=%1
IF [%1]==[] goto usage
+REM -help is a special case to faciliate folks learning about how to use Solr.
IF "%1"=="-help" goto run_solrcli
IF "%1"=="-usage" goto run_solrcli
IF "%1"=="-h" goto run_solrcli
@@ -322,7 +323,6 @@ IF "%FIRST_ARG%"=="-help" goto run_solrcli
IF "%FIRST_ARG%"=="-usage" goto run_solrcli
IF "%FIRST_ARG%"=="-h" goto run_solrcli
IF "%FIRST_ARG%"=="--help" goto run_solrcli
-IF "%FIRST_ARG%"=="-help" goto run_solrcli
IF "%FIRST_ARG%"=="/?" goto run_solrcli
IF "%SCRIPT_CMD%"=="start" goto start_usage
IF "%SCRIPT_CMD%"=="restart" goto start_usage
@@ -366,7 +366,7 @@ goto done
@echo -f Start Solr in foreground; default starts Solr in the background
@echo and sends stdout / stderr to solr-PORT-console.log
@echo.
-@echo -c or -cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
+@echo -c or --cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
@echo solr.in.cmd, an embedded ZooKeeper instance is started on Solr port+1000,
@echo such as 9983 if Solr is bound to 8983
@echo.
@@ -1915,10 +1915,10 @@ IF "!ZK_OP!"=="" (
set CONNECTION_PARAMS=""
IF "!ZK_OP!"=="" (
- set CONNECTION_PARAMS="-solrUrl !ZK_SOLR_URL!"
+ set CONNECTION_PARAMS="--solr-url !ZK_SOLR_URL!"
)
ELSE (
- set CONNECTION_PARAMS="-zkHost ZK_HOST!"
+ set CONNECTION_PARAMS="--zk-host ZK_HOST!"
)
IF "!ZK_OP!"=="-upconfig" (
diff --git a/solr/core/src/java/org/apache/solr/cli/CreateTool.java b/solr/core/src/java/org/apache/solr/cli/CreateTool.java
index 6d13d930ae6..db79cf60a08 100644
--- a/solr/core/src/java/org/apache/solr/cli/CreateTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/CreateTool.java
@@ -406,7 +406,7 @@ public class CreateTool extends ToolBase {
final String configCommand =
String.format(
Locale.ROOT,
- "bin/solr config -c %s -solrUrl %s -action set-user-property -property update.autoCreateFields -value false",
+ "bin/solr config -c %s -s %s --action set-user-property --property update.autoCreateFields --value false",
collectionName,
solrUrl);
echo(
diff --git a/solr/core/src/java/org/apache/solr/cli/PackageTool.java b/solr/core/src/java/org/apache/solr/cli/PackageTool.java
index 82ed30cf409..cc86e730cf0 100644
--- a/solr/core/src/java/org/apache/solr/cli/PackageTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/PackageTool.java
@@ -213,8 +213,9 @@ public class PackageTool extends ToolBase {
: new String[] {};
packageManager.undeploy(packageName, collections, cli.hasOption("cluster"));
} else {
+
printRed(
- "Either specify -cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
+ "Either specify --cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
}
break;
}
@@ -267,7 +268,7 @@ public class PackageTool extends ToolBase {
format(sb, "");
formatGreen(
sb,
- "bin/solr package deploy <package-name>[:<version>] [-y] [--update] -collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
+ "bin/solr package deploy <package-name>[:<version>] [-y] [--update] --collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
format(
sb,
"Bootstraps a previously installed package into the specified collections. It the package accepts parameters for its setup commands, they can be specified (as per package documentation).");
@@ -285,7 +286,7 @@ public class PackageTool extends ToolBase {
format(sb, "Print a list of collections on which a given package has been deployed.");
format(sb, "");
formatGreen(
- sb, "bin/solr package undeploy <package-name> -collections <comma-separated-collections>");
+ sb, "bin/solr package undeploy <package-name> --collections <comma-separated-collections>");
format(sb, "Undeploy a package from specified collection(s)");
format(sb, "");
formatGreen(sb, "bin/solr package uninstall <package-name>:<version>");
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
index 1b671c0e172..15b6def6ecb 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java
@@ -121,7 +121,7 @@ public class PackageManager implements Closeable {
+ packageName
+ " is currently deployed on collection: "
+ collection
- + ". Undeploy the package with undeploy <package-name> -collections <collection1>[,<collection2>,...] before attempting to uninstall the package.");
+ + ". Undeploy the package with undeploy <package-name> --collections <collection1>[,<collection2>,...] before attempting to uninstall the package.");
System.exit(1);
}
}
@@ -138,7 +138,7 @@ public class PackageManager implements Closeable {
+ packageName
+ "is currently deployed as a cluster-level plugin ("
+ clusterPackageInstance.getCustomData()
- + "). Undeploy the package with undeploy <package-name> -collections <collection1>[,<collection2>,...] before uninstalling the package.");
+ + "). Undeploy the package with undeploy <package-name> --collections <collection1>[,<collection2>,...] before uninstalling the package.");
System.exit(1);
}
}
diff --git a/solr/core/src/test/org/apache/solr/cli/AuthToolTest.java b/solr/core/src/test/org/apache/solr/cli/AuthToolTest.java
index 60f5271c12f..8c32db28026 100644
--- a/solr/core/src/test/org/apache/solr/cli/AuthToolTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/AuthToolTest.java
@@ -70,7 +70,7 @@ public class AuthToolTest extends SolrCloudTestCase {
dir.toAbsolutePath().toString(),
"--solr-include-file",
solrIncludeFile.toAbsolutePath().toString(),
- "-credentials",
+ "--credentials",
"solr:solr",
"--block-unknown",
"true"
diff --git a/solr/core/src/test/org/apache/solr/cli/SolrCLIZkToolsTest.java b/solr/core/src/test/org/apache/solr/cli/SolrCLIZkToolsTest.java
index 3da316a1702..2470d01dbf8 100644
--- a/solr/core/src/test/org/apache/solr/cli/SolrCLIZkToolsTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/SolrCLIZkToolsTest.java
@@ -768,7 +768,8 @@ public class SolrCLIZkToolsTest extends SolrCloudTestCase {
int res = tool.runTool(SolrCLI.processCommandLineArgs(tool, args));
assertTrue(
- "Should have failed to remove node with children unless -recurse is set to true", res != 0);
+ "Should have failed to remove node with children unless --recurse is set to true",
+ res != 0);
// Are we sure all the znodes are still there?
verifyZkLocalPathsMatch(srcPathCheck, "/configs/rm1");
@@ -783,7 +784,7 @@ public class SolrCLIZkToolsTest extends SolrCloudTestCase {
res = tool.runTool(SolrCLI.processCommandLineArgs(tool, args));
assertTrue(
- "Should have failed to remove node with children if -recurse is set to false", res != 0);
+ "Should have failed to remove node with children if --recurse is set to false", res != 0);
args =
new String[] {
diff --git a/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java b/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java
index 5066e24de8d..4e501fe052c 100644
--- a/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java
@@ -636,14 +636,14 @@ public class ZkSubcommandsTest extends SolrTestCaseJ4 {
// add property urlScheme=http
String[] args =
new String[] {
- "cluster", "-property", "urlScheme", "-value", "http", "-z", zkServer.getZkAddress()
+ "cluster", "--property", "urlScheme", "--value", "http", "-z", zkServer.getZkAddress()
};
ClusterTool tool = new ClusterTool();
assertEquals(0, runTool(args, tool));
assertEquals("http", properties.getClusterProperty("urlScheme", "none"));
- args = new String[] {"cluster", "-property", "urlScheme", "-z", zkServer.getZkAddress()};
+ args = new String[] {"cluster", "--property", "urlScheme", "-z", zkServer.getZkAddress()};
assertEquals(0, runTool(args, tool));
assertNull(properties.getClusterProperty("urlScheme", (String) null));
}
diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/util/HdfsRecoverLeaseFileSystemUtils.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/util/HdfsRecoverLeaseFileSystemUtils.java
index b0bd7960bff..2d5cd6a06ac 100644
--- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/util/HdfsRecoverLeaseFileSystemUtils.java
+++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/util/HdfsRecoverLeaseFileSystemUtils.java
@@ -54,7 +54,7 @@ public class HdfsRecoverLeaseFileSystemUtils {
/*
* Run the dfs recover lease. recoverLease is asynchronous. It returns:
- * -false when it starts the lease recovery (i.e. lease recovery not *yet* done)
+ * - false when it starts the lease recovery (i.e. lease recovery not *yet* done)
* - true when the lease recovery has succeeded or the file is closed.
* But, we have to be careful. Each time we call recoverLease, it starts the recover lease
* process over from the beginning. We could put ourselves in a situation where we are
diff --git a/solr/packaging/test/test_adminconsole_urls.bats b/solr/packaging/test/test_adminconsole_urls.bats
index 68fb79df3ed..2ab86af39cd 100644
--- a/solr/packaging/test/test_adminconsole_urls.bats
+++ b/solr/packaging/test/test_adminconsole_urls.bats
@@ -25,7 +25,7 @@ teardown() {
# save a snapshot of SOLR_HOME for failed tests
save_home_on_failure
- solr stop -all >/dev/null 2>&1
+ solr stop --all >/dev/null 2>&1
}
@test "assert able to launch solr admin console" {
diff --git a/solr/packaging/test/test_create_collection.bats b/solr/packaging/test/test_create_collection.bats
index e5e5a808ee4..2247cab9ffa 100644
--- a/solr/packaging/test/test_create_collection.bats
+++ b/solr/packaging/test/test_create_collection.bats
@@ -69,7 +69,7 @@ teardown() {
}
@test "reject d option with invalid config dir" {
- run ! solr create -c COLL_NAME -d /asdf
+ run ! solr create -c COLL_NAME -d /asdf --solr-url http://localhost:${SOLR_PORT}
assert_output --partial "Specified configuration directory /asdf not found!"
}
@@ -114,4 +114,4 @@ teardown() {
run -0 solr create -c COLL_NAME -rf 2 --solr-url http://localhost:${SOLR_PORT}/solr
assert_output --partial "Created collection 'COLL_NAME'"
assert_output --partial "2 replica(s)"
-}
\ No newline at end of file
+}
diff --git a/solr/packaging/test/test_extraction.bats b/solr/packaging/test/test_extraction.bats
index 8c3c9589ba1..ef7dfa29714 100644
--- a/solr/packaging/test/test_extraction.bats
+++ b/solr/packaging/test/test_extraction.bats
@@ -73,7 +73,7 @@ teardown() {
}' "http://localhost:${SOLR_PORT}/solr/content_extraction/config"
# We filter to pdf to invoke the Extract handler.
- run solr post -filetypes pdf -url http://localhost:${SOLR_PORT}/solr/content_extraction/update ${SOLR_TIP}/example/exampledocs
+ run solr post --filetypes pdf -url http://localhost:${SOLR_PORT}/solr/content_extraction/update ${SOLR_TIP}/example/exampledocs
assert_output --partial '1 files indexed.'
refute_output --partial 'ERROR'
@@ -99,8 +99,8 @@ teardown() {
}
}' "http://localhost:${SOLR_PORT}/solr/website_extraction/config"
- # Change to -recursive 1 to crawl multiple pages, but may be too slow.
- run solr post -mode web -url http://localhost:${SOLR_PORT}/solr/website_extraction/update -recursive 0 -delay 1 https://solr.apache.org/
+ # Change to --recursive 1 to crawl multiple pages, but may be too slow.
+ run solr post --mode web --solr-update-url http://localhost:${SOLR_PORT}/solr/website_extraction/update --recursive 0 --delay 1 https://solr.apache.org/
assert_output --partial 'POSTed web resource https://solr.apache.org (depth: 0)'
refute_output --partial 'ERROR'
diff --git a/solr/packaging/test/test_packages.bats b/solr/packaging/test/test_packages.bats
index ee091ad275c..7d446412d48 100644
--- a/solr/packaging/test/test_packages.bats
+++ b/solr/packaging/test/test_packages.bats
@@ -44,7 +44,7 @@ teardown() {
solr create_collection -c foo-1.2
# Deploy package - the package doesn't need to exist before the collection validation kicks in
- run solr package deploy PACKAGE_NAME -collections foo-1.2
+ run solr package deploy PACKAGE_NAME --collections foo-1.2
# assert_output --partial "Deployment successful"
refute_output --partial "Invalid collection"
@@ -52,7 +52,7 @@ teardown() {
assert_output --partial "Package instance doesn't exist: PACKAGE_NAME:null"
# Undeploy package
- run solr package undeploy PACKAGE_NAME -collections foo-1.2
+ run solr package undeploy PACKAGE_NAME --collections foo-1.2
refute_output --partial "Invalid collection"
assert_output --partial "Package PACKAGE_NAME not deployed on collection foo-1.2"
}
@@ -72,7 +72,7 @@ teardown() {
# run solr package install solr-splainer
# assert_output --partial "solr-splainer installed."
-# run solr package deploy solr-splainer -y -cluster
+# run solr package deploy solr-splainer -y --cluster
# assert_output --partial "Deployment successful"
# run -0 curl --fail http://localhost:${SOLR_PORT}/v2/splainer/index.html
diff --git a/solr/packaging/test/test_post.bats b/solr/packaging/test/test_post.bats
index bb9b2e6cb1a..38652a8c5da 100644
--- a/solr/packaging/test/test_post.bats
+++ b/solr/packaging/test/test_post.bats
@@ -162,14 +162,14 @@ teardown() {
run solr create -c test_args -d _default
assert_output --partial "Created collection 'test_args'"
- run solr post --solr-update-url http://localhost:${SOLR_PORT}/solr/test_args/update --mode args -type application/xml --out "<delete><query>*:*</query></delete>"
+ run solr post --solr-update-url http://localhost:${SOLR_PORT}/solr/test_args/update --mode args --type application/xml --out "<delete><query>*:*</query></delete>"
assert_output --partial '<int name="status">0</int>'
# confirm default type
run solr post --solr-update-url http://localhost:${SOLR_PORT}/solr/test_args/update --mode args --out "{'delete': {'query': '*:*'}}"
assert_output --partial '"status":0'
- # confirm we don't get back output without -out
+ # confirm we don't get back output without --out
run solr post --solr-update-url http://localhost:${SOLR_PORT}/solr/test_args/update --mode args "{'delete': {'query': '*:*'}}"
refute_output --partial '"status":0'
diff --git a/solr/packaging/test/test_prometheus.bats b/solr/packaging/test/test_prometheus.bats
index 25353a7e0ab..66526f79484 100644
--- a/solr/packaging/test/test_prometheus.bats
+++ b/solr/packaging/test/test_prometheus.bats
@@ -25,7 +25,7 @@ teardown() {
# save a snapshot of SOLR_HOME for failed tests
save_home_on_failure
- solr stop -all >/dev/null 2>&1
+ solr stop --all >/dev/null 2>&1
shutdown_exporter
}
diff --git a/solr/packaging/test/test_ssl.bats b/solr/packaging/test/test_ssl.bats
index 3eb4dd2c75c..4f5ae15eba9 100644
--- a/solr/packaging/test/test_ssl.bats
+++ b/solr/packaging/test/test_ssl.bats
@@ -604,7 +604,7 @@ teardown() {
run solr api -get "https://localhost:${SOLR2_PORT}/solr/test-single-shard/select?q=query4"
assert_output --partial '"numFound":0'
- run solr post -url https://localhost:${SOLR_PORT}/solr/test/update ${SOLR_TIP}/example/exampledocs/books.csv
+ run solr post --solr-update-url https://localhost:${SOLR_PORT}/solr/test/update ${SOLR_TIP}/example/exampledocs/books.csv
run solr api -get "https://localhost:${SOLR_PORT}/solr/test/select?q=*:*"
assert_output --partial '"numFound":10'
diff --git a/solr/packaging/test/test_zk.bats b/solr/packaging/test/test_zk.bats
index 0df60161f0c..be7e2c25d1d 100644
--- a/solr/packaging/test/test_zk.bats
+++ b/solr/packaging/test/test_zk.bats
@@ -140,7 +140,7 @@ teardown() {
@test "bin/solr zk cp gets 'solrhome' from '--solr-home' command line option" {
touch afile.txt
- run solr zk cp afile.txt zk:/afile.txt -z localhost:${ZK_PORT} -verbose --solr-home ${SOLR_TIP}/server/solr
+ run solr zk cp afile.txt zk:/afile.txt -z localhost:${ZK_PORT} --verbose --solr-home ${SOLR_TIP}/server/solr
assert_output --partial "Using SolrHome: ${SOLR_TIP}/server/solr"
refute_output --partial 'Failed to load solr.xml from ZK or SolrHome'
diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/package-manager.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/package-manager.adoc
index c571f9d6faa..806def2af7f 100644
--- a/solr/solr-ref-guide/modules/configuration-guide/pages/package-manager.adoc
+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/package-manager.adoc
@@ -109,7 +109,7 @@ or
[source,bash]
----
-$ bin/solr package deploy <package-name>:[version] -cluster
+$ bin/solr package deploy <package-name>:[version] --cluster
----
If the package accepts parameters for its setup commands, they can be specified (as per package documentation):
@@ -170,12 +170,12 @@ Assuming the old version is `1.0.0` of the package `mypackage`, and the new vers
[source,bash]
----
-$ bin/solr package deploy mypackage:2.0.0 --update -collections mycollection
+$ bin/solr package deploy mypackage:2.0.0 --update --collections mycollection
----
or
[source,bash]
----
-$ bin/solr package deploy mypackage:2.0.0 --update -cluster
+$ bin/solr package deploy mypackage:2.0.0 --update --cluster
----
You can run the `list-deployed` command to verify that this collection is using the newly added version.
@@ -186,7 +186,7 @@ If a package supports undeploying the plugins it contains (check package author'
[source,bash]
----
-$ bin/solr package undeploy <package-name> -collections <collection1>[,<collection2>,...]
+$ bin/solr package undeploy <package-name> --collections <collection1>[,<collection2>,...]
----
=== Uninstall a Package
@@ -202,7 +202,7 @@ or
[source,bash]
----
-$ bin/solr package deploy <package-name>:<package-version> -cluster
+$ bin/solr package deploy <package-name>:<package-version> --cluster
----
Both package name and version are required.
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc
index 64eac73e73d..db5880049e0 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc
@@ -234,7 +234,7 @@ The examples below use the `zkcli` tool that comes with Solr to do this.
====
[source,terminal]
----
-$ bin/solr cluster -property urlSchema -value https -z server1:2181,server2:2181,server3:2181
+$ bin/solr cluster --property urlSchema --value https -z server1:2181,server2:2181,server3:2181
----
====
@@ -243,13 +243,13 @@ Windows::
====
[source,powershell]
----
-C:\> bin/solr.cmd -property urlSchema -value https -z server1:2181,server2:2181,server3:2181
+C:\> bin/solr.cmd --property urlSchema --value https -z server1:2181,server2:2181,server3:2181
----
====
======
Be sure to use the correct `zkhost` value for your system.
-If you have set up your ZooKeeper ensemble to use a xref:taking-solr-to-production.adoc#zookeeper-chroot[chroot for Solr], make sure to include it in the `zkhost` string, e.g., `-zkhost server1:2181,server2:2181,server3:2181/solr`.
+If you have set up your ZooKeeper ensemble to use a xref:taking-solr-to-production.adoc#zookeeper-chroot[chroot for Solr], make sure to include it in the `zkHost` string, e.g., `--zk-host server1:2181,server2:2181,server3:2181/solr`.
=== Update Cluster Properties for Existing Collections
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
index dd50210c826..66a8398aa87 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
@@ -248,7 +248,7 @@ This can be useful in a production setting where you want to limit logging to wa
+
*Example*: `bin/solr start -f -q`
-`-V` or `-verbose`::
+`-V` or `--verbose`::
+
[%autowidth,frame=none]
|===
@@ -273,7 +273,7 @@ Set the `ZK_CREATE_CHROOT` environment variable to true if your ZK host has a ch
+
*Example*: `bin/solr start -c -z server1:2181,server2:2181`
-`-force`::
+`--force`::
+
[%autowidth,frame=none]
|===
@@ -281,9 +281,9 @@ Set the `ZK_CREATE_CHROOT` environment variable to true if your ZK host has a ch
|===
+
If attempting to start Solr as the root user, the script will exit with a warning that running Solr as "root" can cause problems.
-It is possible to override this warning with the `-force` parameter.
+It is possible to override this warning with the `--force` parameter.
+
-*Example*: `sudo bin/solr start -force`
+*Example*: `sudo bin/solr start --force`
To emphasize how the default settings work take a moment to understand that the following commands are equivalent:
@@ -400,7 +400,7 @@ The command will wait up to 180 seconds for Solr to stop gracefully and then wil
|===
+
Stop Solr running on the given port.
-If you are running more than one instance, or are running in SolrCloud mode, you either need to specify the ports in separate requests or use the `-all` option.
+If you are running more than one instance, or are running in SolrCloud mode, you either need to specify the ports in separate requests or use the `--all` option.
+
*Example*: `bin/solr stop -p 8983`
@@ -426,7 +426,7 @@ Stop key used to protect from stopping Solr inadvertently; default is "solrrocks
+
*Example*: `bin/solr stop -k solrrocks`
-`-V` or `-verbose`::
+`-V` or `--verbose`::
+
[%autowidth,frame=none]
|===
@@ -725,7 +725,7 @@ The default is `1` (no replication).
+
*Example*: `bin/solr create -rf 2`
-`-force`::
+`--force`::
+
[%autowidth,frame=none]
|===
@@ -733,11 +733,11 @@ The default is `1` (no replication).
|===
+
If attempting to run create as "root" user, the script will exit with a warning that running Solr or actions against Solr as "root" can cause problems.
-It is possible to override this warning with the -force parameter.
+It is possible to override this warning with the --force parameter.
+
*Example*: `bin/solr create -c foo --force`
-`-z <zkHost>` or `-zk-host <zkHost>`::
+`-z <zkHost>` or `--zk-host <zkHost>`::
+
[%autowidth,frame=none]
|===
@@ -1091,10 +1091,10 @@ The command takes the following parameters:
The username and password in the format of `username:password` of the initial user.
Applicable for basicAuth only.
+
-If you prefer not to pass the username and password as an argument to the script, you can choose the `-prompt` option.
-Either `-credentials` or `-prompt` *must* be specified.
+If you prefer not to pass the username and password as an argument to the script, you can choose the `--prompt` option.
+Either `--credentials` or `--prompt` *must* be specified.
-`-prompt <true|false>`::
+`--prompt <true|false>`::
+
[%autowidth,frame=none]
|===
@@ -1103,7 +1103,7 @@ Either `-credentials` or `-prompt` *must* be specified.
+
Prompts the user to provide the credentials. If prompt is preferred, pass `true` as a parameter to request the script prompt the user to enter a username and password.
+
-Either `-credentials` or `-prompt` *must* be specified.
+Either `--credentials` or `--prompt` *must* be specified.
`--block-unknown <true|false>`::
+
@@ -1115,7 +1115,7 @@ Either `-credentials` or `-prompt` *must* be specified.
When `true`, this blocks out access to unauthenticated users from accessing Solr.
When `false`, unauthenticated users will still be able to access Solr, but only for operations not explicitly requiring a user role in the Authorization plugin configuration.
-`-solrIncludeFile <includeFilePath>`::
+`--solrIncludeFile <includeFilePath>`::
+
[%autowidth,frame=none]
|===
@@ -1142,7 +1142,7 @@ If not specified this script looks for an include file named solr.in.sh to set e
+
When `true`, only update the `bin/solr.in.sh` or `bin\solr.in.cmd`, and skip actual enabling/disabling authentication (i.e. don't update `security.json`).
-`-z <zkHost>` or `-zk-host <zkHost>`::
+`-z <zkHost>` or `--zk-host <zkHost>`::
+
[%autowidth,frame=none]
|===
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
index cd5d89bb5d3..292d63a44a2 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
@@ -93,7 +93,7 @@ To see available options, simply do:
[source,bash]
----
-sudo bash ./install_solr_service.sh -help
+sudo bash ./install_solr_service.sh --help
----
Once the script completes, Solr will be installed as a service and running in the background on your server (on port 8983).
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc
index c5e7af2fc62..3c63c0ce41a 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc
@@ -40,7 +40,7 @@ Use the `help` option to get a list of available ZooKeeper specifc commands from
== Solr CLI Examples
-Below are some examples of using the `bin/solr` CLI which assume you have already started the SolrCloud example (`bin/solr start -e cloud -noprompt`)
+Below are some examples of using the `bin/solr` CLI which assume you have already started the SolrCloud example (`bin/solr start -e cloud --no-prompt`)
=== Upload a Configuration Directory
diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
index ba117920eaf..dd308f6ef18 100644
--- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
+++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
@@ -243,7 +243,7 @@ $ bin/solr post -c films example/films/films.xml
======
[,console]
----
-$ bin/solr post -c films example/films/films.csv -params "f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=|"
+$ bin/solr post -c films example/films/films.csv --params "f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=|"
----
======
diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc
index 8800d85c018..14b26ed556d 100644
--- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc
+++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc
@@ -128,7 +128,7 @@ You can also use `bin/solr post` to do the same thing:
[,console]
----
-$ bin/solr post -c gettingstarted example/exampledocs/solr-word.pdf -params "literal.id=doc1"
+$ bin/solr post -c gettingstarted example/exampledocs/solr-word.pdf --params "literal.id=doc1"
----
Now you can execute a query and find that document with a request like `\http://localhost:8983/solr/gettingstarted/select?q=pdf`.
@@ -148,7 +148,7 @@ Here's an example:
[,console]
----
-$ bin/solr post -c gettingstarted example/exampledocs/solr-word.pdf -params "literal.id=doc1&uprefix=ignored_&fmap.last_modified=last_modified_dt"
+$ bin/solr post -c gettingstarted example/exampledocs/solr-word.pdf --params "literal.id=doc1&uprefix=ignored_&fmap.last_modified=last_modified_dt"
----
[NOTE]
@@ -563,7 +563,7 @@ The command below captures `<div>` tags separately (`capture=div`), and then map
[,console]
----
-$ bin/solr post -c gettingstarted example/exampledocs/sample.html -params "literal.id=doc2&captureAttr=true&defaultField=_text_&fmap.div=foo_t&capture=div"
+$ bin/solr post -c gettingstarted example/exampledocs/sample.html --params "literal.id=doc2&captureAttr=true&defaultField=_text_&fmap.div=foo_t&capture=div"
----
=== Using Literals to Define Custom Metadata
@@ -572,7 +572,7 @@ To add in your own metadata, pass in the literal parameter along with the file:
[,console]
----
-$ bin/solr post -c gettingstarted -params "literal.id=doc4&captureAttr=true&defaultField=text&capture=div&fmap.div=foo_t&literal.blah_s=Bah" example/exampledocs/sample.html
+$ bin/solr post -c gettingstarted --params "literal.id=doc4&captureAttr=true&defaultField=text&capture=div&fmap.div=foo_t&literal.blah_s=Bah" example/exampledocs/sample.html
----
The parameter `literal.blah_s=Bah` will insert a field `blah_s` into every document.
@@ -584,7 +584,7 @@ The example below passes in an XPath expression to restrict the XHTML returned b
[,console]
----
-$ bin/solr post -c gettingstarted -params "literal.id=doc5&captureAttr=true&defaultField=text&capture=div&fmap.div=foo_t&xpath=/xhtml:html/xhtml:body/xhtml:div//node()" example/exampledocs/sample.html
+$ bin/solr post -c gettingstarted --params "literal.id=doc5&captureAttr=true&defaultField=text&capture=div&fmap.div=foo_t&xpath=/xhtml:html/xhtml:body/xhtml:div//node()" example/exampledocs/sample.html
----
=== Extracting Data without Indexing
@@ -603,7 +603,7 @@ The output includes XML generated by Tika (and further escaped by Solr's XML) us
[,console]
----
-$ bin/solr post -c gettingstarted -params "extractOnly=true&wt=ruby&indent=true" -out yes example/exampledocs/sample.html
+$ bin/solr post -c gettingstarted --params "extractOnly=true&wt=ruby&indent=true" --out yes example/exampledocs/sample.html
----
=== Using Solr Cell with a POST Request
diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adoc
index a36f0488217..10600182b8b 100644
--- a/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adoc
+++ b/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adoc
@@ -138,7 +138,7 @@ Send XML arguments to delete a document from `gettingstarted`.
[,console]
----
-$ bin/solr post -url http://localhost:8983/solr/gettingstarted/update -mode args -type application/xml '<delete><id>42</id></delete>'
+$ bin/solr post -url http://localhost:8983/solr/gettingstarted/update --mode args --type application/xml '<delete><id>42</id></delete>'
----
=== Indexing CSV and JSON
@@ -147,14 +147,14 @@ Index all CSV and JSON files into `gettingstarted` from current directory:
[,console]
----
-$ bin/solr post -c gettingstarted -filetypes json,csv .
+$ bin/solr post -c gettingstarted --filetypes json,csv .
----
Index a tab-separated file into `gettingstarted`:
[,console]
----
-$ bin/solr post -url http://localhost:8984/solr/signals/update -params "separator=%09" -type text/csv data.tsv
+$ bin/solr post -url http://localhost:8984/solr/signals/update --params "separator=%09" --type text/csv data.tsv
----
The content type (`-type`) parameter is required to treat the file as the proper type, otherwise it will be ignored and a WARNING logged as it does not know what type of content a .tsv file is.
@@ -180,7 +180,7 @@ Automatically detect content types in a folder, but limit it to PPT and HTML fil
[,console]
----
-$ bin/solr post -url http://localhost:8983/solr/gettingstarted/update -filetypes ppt,html afolder/
+$ bin/solr post -url http://localhost:8983/solr/gettingstarted/update --filetypes ppt,html afolder/
----
=== Indexing to a Password Protected Solr (Basic Auth)
@@ -200,7 +200,7 @@ See xref:indexing-with-tika.adoc#trying-out-solr-cell[Trying Out Solr Cell] to l
[,console]
----
-$ bin/solr post -mode web -c gettingstarted -recursive 1 -delay 1 https://solr.apache.org/
+$ bin/solr post --mode web -c gettingstarted --recursive 1 --delay 1 https://solr.apache.org/
----
=== Standard Input as Source for Indexing
@@ -210,7 +210,7 @@ Notice the `-out` providing raw responses from Solr.
[,console]
----
-$ echo '{commit: {}}' | bin/solr post -mode stdin -url http://localhost:8983/my_collection/update -out
+$ echo '{commit: {}}' | bin/solr post --mode stdin -url http://localhost:8983/my_collection/update --out
----
=== Raw Data as Source for Indexing
@@ -219,5 +219,5 @@ Provide the raw document as a string for indexing.
[,console]
----
-$ bin/solr post -url http://localhost:8983/signals/update -mode args -type text/csv -out $'id,value\n1,0.47'
+$ bin/solr post -url http://localhost:8983/signals/update -mode args --type text/csv -out $'id,value\n1,0.47'
----
diff --git a/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc b/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc
index cb714e2f8ac..68fba64f500 100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc
@@ -71,9 +71,7 @@ However, it's much bulkier than the raw coordinates for such simple data.
Using the `bin/solr post` tool:
[,console]
-----
-$ bin/solr post -type "application/json" -url "http://localhost:8983/solr/mycollection/update?format=geojson" /path/to/geojson.file
-----
+$ bin/solr post -t "application/json" -url "http://localhost:8983/solr/mycollection/update?format=geojson" /path/to/geojson.file
The key parameter to pass in with your request is:
diff --git a/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc b/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc
index 7ec9849d24c..2cb2e0589fe 100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc
@@ -277,8 +277,8 @@ population.
Using bin/solr post:
[,console]
----
-$ bin/solr post -c geonames -type text/csv \
- -params 'optimize=true&maxSegments=1&separator=%09&encapsulator=%00&fieldnames=id,name,,alternative_names,latitude,longitude,,,countrycode,,,,,,population,elevation,,timezone,lastupdate' \
+$ bin/solr post -c geonames -t text/csv \
+ --params 'optimize=true&maxSegments=1&separator=%09&encapsulator=%00&fieldnames=id,name,,alternative_names,latitude,longitude,,,countrycode,,,,,,population,elevation,,timezone,lastupdate' \
/tmp/cities1000.txt
----
diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
index 7acb40eb3b5..a3fe06f4a11 100644
--- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
@@ -137,7 +137,7 @@ public class ZkMaintenanceUtils {
throw new SolrServerException("One or both of source or destination must specify ZK nodes.");
}
- // Make sure -recurse is specified if the source has children.
+ // Make sure --recurse is specified if the source has children.
if (recurse == false) {
if (srcIsZk) {
if (zkClient.getChildren(src, null, true).size() != 0) {