Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16824: Replace deprecated single-dash arguments (#2577)

Christos Malliaridis030b0dcd02b0
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 99533e5f97c..27874851fe3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -181,7 +181,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, janhoy, 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 0eb25adce14..58fb4e6599e 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
@@ -293,7 +294,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
@@ -316,7 +316,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.
@@ -1493,10 +1493,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 f828ac77423..61031ae5cc9 100644
--- a/solr/core/src/java/org/apache/solr/cli/CreateTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/CreateTool.java
@@ -411,7 +411,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 a8fdd5afd18..c3f4a3a9e96 100644
--- a/solr/core/src/java/org/apache/solr/cli/PackageTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/PackageTool.java
@@ -205,8 +205,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;
}
@@ -259,7 +260,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).");
@@ -277,7 +278,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/CreateToolTest.java b/solr/core/src/test/org/apache/solr/cli/CreateToolTest.java
index 333b541f7e6..838c3857ce9 100644
--- a/solr/core/src/test/org/apache/solr/cli/CreateToolTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/CreateToolTest.java
@@ -49,7 +49,7 @@ public class CreateToolTest extends SolrCloudTestCase {
"cloud-minimal",
"-z",
cluster.getZkClient().getZkServerAddress(),
- "-credentials",
+ "--credentials",
SecurityJson.USER_PASS,
"-verbose"
};
diff --git a/solr/core/src/test/org/apache/solr/cli/DeleteToolTest.java b/solr/core/src/test/org/apache/solr/cli/DeleteToolTest.java
index 535ffc75573..86459b1f71a 100644
--- a/solr/core/src/test/org/apache/solr/cli/DeleteToolTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/DeleteToolTest.java
@@ -64,7 +64,7 @@ public class DeleteToolTest extends SolrCloudTestCase {
"false",
"-z",
cluster.getZkClient().getZkServerAddress(),
- "-credentials",
+ "--credentials",
SecurityJson.USER_PASS,
"-verbose"
};
diff --git a/solr/core/src/test/org/apache/solr/cli/PostToolTest.java b/solr/core/src/test/org/apache/solr/cli/PostToolTest.java
index 1f507b281b5..6f7d167e106 100644
--- a/solr/core/src/test/org/apache/solr/cli/PostToolTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/PostToolTest.java
@@ -127,7 +127,7 @@ public class PostToolTest extends SolrCloudTestCase {
fw.flush();
String[] args = {
- "post", "-c", collection, "-credentials", SecurityJson.USER_PASS, jsonDoc.getAbsolutePath()
+ "post", "-c", collection, "--credentials", SecurityJson.USER_PASS, jsonDoc.getAbsolutePath()
};
assertEquals(0, runTool(args));
@@ -167,7 +167,7 @@ public class PostToolTest extends SolrCloudTestCase {
"post",
"-c",
collection,
- "-credentials",
+ "--credentials",
SecurityJson.USER_PASS,
"--params",
"\"separator=%09&header=false&fieldnames=id,title_s\"",
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/TestExportTool.java b/solr/core/src/test/org/apache/solr/cli/TestExportTool.java
index 1223925058b..357fd26d690 100644
--- a/solr/core/src/test/org/apache/solr/cli/TestExportTool.java
+++ b/solr/core/src/test/org/apache/solr/cli/TestExportTool.java
@@ -245,7 +245,7 @@ public class TestExportTool extends SolrCloudTestCase {
"export",
"-url",
cluster.getJettySolrRunner(0).getBaseUrl() + "/" + COLLECTION_NAME,
- "-credentials",
+ "--credentials",
SecurityJson.USER_PASS,
"-out",
outFile.getAbsolutePath(),
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 8185c5b1457..250cee1a955 100644
--- a/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java
+++ b/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java
@@ -635,14 +635,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_basic_auth.bats b/solr/packaging/test/test_basic_auth.bats
index 8cd997a08ad..9cdebb7af18 100644
--- a/solr/packaging/test/test_basic_auth.bats
+++ b/solr/packaging/test/test_basic_auth.bats
@@ -49,15 +49,15 @@ teardown() {
assert_output --partial "Created collection 'COLL_NAME'"
# Test config
- run solr config -u name:password -c COLL_NAME --action set-property -property updateHandler.autoCommit.maxDocs --value 100 --solr-url http://localhost:${SOLR_PORT}/solr
+ run solr config -u name:password -c COLL_NAME --action set-property --property updateHandler.autoCommit.maxDocs --value 100 --solr-url http://localhost:${SOLR_PORT}/solr
assert_output --partial "Successfully set-property updateHandler.autoCommit.maxDocs to 100"
# Test api
- run solr api -u name:password --solr-url "http://localhost:${SOLR_PORT}/solr/COLL_NAME/select?q=*:*" -verbose
+ run solr api -u name:password --solr-url "http://localhost:${SOLR_PORT}/solr/COLL_NAME/select?q=*:*" --verbose
assert_output --partial '"numFound":0'
# Test delete
- run solr delete --credentials name:password -c COLL_NAME -z localhost:${ZK_PORT} -verbose
+ run solr delete --credentials name:password -c COLL_NAME -z localhost:${ZK_PORT} --verbose
assert_output --partial "Deleted collection 'COLL_NAME'"
refute collection_exists "COLL_NAME"
@@ -69,7 +69,7 @@ run solr create -c COLL_NAME
assert_output --partial "Created collection 'COLL_NAME'"
# Test post
- run solr post -u name:password -type application/xml --solr-update-url http://localhost:${SOLR_PORT}/solr/monitors/update ${SOLR_TIP}/example/exampledocs/monitor.xml
+ run solr post -u name:password -t application/xml --solr-update-url http://localhost:${SOLR_PORT}/solr/monitors/update ${SOLR_TIP}/example/exampledocs/monitor.xml
assert_output --partial '1 files indexed.'
# Test postlogs
diff --git a/solr/packaging/test/test_create_collection.bats b/solr/packaging/test/test_create_collection.bats
index 05ec63d7f74..3ffa6bd0ff3 100644
--- a/solr/packaging/test/test_create_collection.bats
+++ b/solr/packaging/test/test_create_collection.bats
@@ -63,7 +63,7 @@ teardown() {
}
@test "reject d option with invalid config dir" {
- run ! solr create -c COLL_NAME -d /asdf -solrUrl http://localhost:${SOLR_PORT}
+ run ! solr create -c COLL_NAME -d /asdf --solr-url http://localhost:${SOLR_PORT}
assert_output --partial "Specified configuration directory /asdf not found!"
}
diff --git a/solr/packaging/test/test_extraction.bats b/solr/packaging/test/test_extraction.bats
index 7557dc93b94..346f1df431a 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 185b3381b83..7de497a8d8c 100644
--- a/solr/packaging/test/test_packages.bats
+++ b/solr/packaging/test/test_packages.bats
@@ -44,7 +44,7 @@ teardown() {
solr create -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 72dbb3b4690..9af9a515922 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 08b3fc1d786..d114c15e25d 100644
--- a/solr/packaging/test/test_ssl.bats
+++ b/solr/packaging/test/test_ssl.bats
@@ -604,7 +604,7 @@ teardown() {
run solr api --solr-url "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 --solr-url "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 1c2c2a2bad7..817a33e1054 100644
--- a/solr/packaging/test/test_zk.bats
+++ b/solr/packaging/test/test_zk.bats
@@ -122,7 +122,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 f7e37aa77c4..d2bbc8a279a 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 9a0d0f87b42..3a517224747 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]
|===
@@ -720,7 +720,7 @@ The default is `1` (no replication).
+
*Example*: `bin/solr create -rf 2`
-`-force`::
+`--force`::
+
[%autowidth,frame=none]
|===
@@ -728,11 +728,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]
|===
@@ -935,10 +935,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]
|===
@@ -947,7 +947,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>`::
+
@@ -959,7 +959,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]
|===
@@ -986,7 +986,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 a67a49a9e81..4adb5fd6b57 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 2b08e1aea3a..864ccb1b1dd 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
@@ -30,7 +30,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 8191682735c..69622b5c7cc 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 b6cd39a86fa..7d904337aad 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
@@ -135,7 +135,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
@@ -144,14 +144,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.
@@ -177,7 +177,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)
@@ -197,7 +197,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
@@ -207,7 +207,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
@@ -216,5 +216,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) {