Apache Solr open-source search software
SOLR-17526: Deprecate --out in favour of --verbose. (#2812)
Eric Pughdd6f2152c236
diff --git a/solr/core/src/java/org/apache/solr/cli/PostTool.java b/solr/core/src/java/org/apache/solr/cli/PostTool.javaindex 059ae8a1def..d479a90aaba 100644--- a/solr/core/src/java/org/apache/solr/cli/PostTool.java+++ b/solr/core/src/java/org/apache/solr/cli/PostTool.java@@ -278,6 +278,12 @@ public class PostTool extends ToolBase {.build(),Option.builder().longOpt("out")+ .deprecated(+ DeprecatedAttributes.builder()+ .setForRemoval(true)+ .setSince("9.8")+ .setDescription("Use --verbose instead")+ .get()).required(false).desc("sends Solr response outputs to console.").build(),@@ -360,7 +366,10 @@ public class PostTool extends ToolBase {recursive = Integer.parseInt(cli.getOptionValue("recursive", "1"));- out = cli.hasOption("out") ? CLIO.getOutStream() : null;+ out =+ cli.hasOption("out") || cli.hasOption(SolrCLI.OPTION_VERBOSE.getLongOpt())+ ? CLIO.getOutStream()+ : null;commit = !(cli.hasOption("skipcommit") || cli.hasOption("skip-commit"));optimize = cli.hasOption("optimize");diff --git a/solr/packaging/test/test_post.bats b/solr/packaging/test/test_post.batsindex 3d796820029..016dba34d36 100644--- a/solr/packaging/test/test_post.bats+++ b/solr/packaging/test/test_post.bats@@ -203,3 +203,15 @@ capture_echo_to_solr() {run capture_echo_to_solrassert_output --partial '"status":0'}++@test "verbose echo the Solr response" {++ run solr create -c monitors_verbose -d _default+ assert_output --partial "Created collection 'monitors_verbose'"++ run solr post --verbose --type application/xml --solr-update-url http://localhost:${SOLR_PORT}/solr/monitors_verbose/update ${SOLR_TIP}/example/exampledocs/monitor.xml++ assert_output --partial '1 files indexed.'+ assert_output --partial '<lst name="responseHeader">'+ refute_output --partial 'ERROR'+}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.adocindex 3d4e1509fbe..b1344ed5519 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@@ -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=json&indent=true" --out yes example/exampledocs/sample.html+$ bin/solr post -c gettingstarted --params "extractOnly=true&wt=json&indent=true" --verbose example/exampledocs/sample.html----=== Using Solr Cell with a POST Requestdiff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/post-tool.adocindex 97f28887d16..4483557dd29 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@@ -41,8 +41,8 @@ The basic usage of `bin/solr post` is:[source,plain]-----usage: bin/solr post [-c <NAME>] [-d <delay>] [--dry-run] [--format] [-ft <<type>[,<type>,...]>] [-h] [--mode <mode>]- [-o] [--out] [--params <<key>=<value>[&<key>=<value>...]>] [-r <recursive>] [-s <HOST>] [--skip-commit] [-t+usage: bin/solr post [-c <NAME>] [--delay <delay>] [--dry-run] [--format] [-ft <<type>[,<type>,...]>] [-h] [--mode+ <mode>] [-o] [--params <<key>=<value>[&<key>=<value>...]>] [-r <recursive>] [-s <HOST>] [--skip-commit] [-t<content-type>] [-u <credentials>] [--verbose]List of options:@@ -61,7 +61,6 @@ List of options:directory, 'web' crawls website, 'args' processes input args, and'stdin' reads a command from standard in. default: files.-o,--optimize Issue an optimize at end of posting documents.- --out sends Solr response outputs to console.--params <<key>=<value>[&<key>=<value>...]> Values must be URL-encoded; these pass through to Solr update request.-r,--recursive <recursive> For web crawl, how deep to go. default: 1-s,--solr-url <HOST> Base Solr URL, which can be used to determine the zk-host if that's@@ -177,11 +176,11 @@ $ bin/solr post --mode web -c gettingstarted --recursive 1 --delay 1 https://sol=== Standard Input as Source for IndexingYou can use the standard input as your source for data to index.-Notice the `-out` providing raw responses from Solr.+Notice the `--verbose` providing raw responses from Solr.[,console]-----$ echo '{commit: {}}' | bin/solr post --mode stdin --solr-url http://localhost:8983 --name my_collection --out+$ echo '{commit: {}}' | bin/solr post --mode stdin --solr-url http://localhost:8983 --name my_collection --verbose----=== Raw Data as Source for Indexing@@ -190,5 +189,5 @@ Provide the raw document as a string for indexing.[,console]-----$ bin/solr post --solr-url http://localhost:8983 --name signals -mode args --type text/csv -out $'id,value\n1,0.47'+$ bin/solr post --solr-url http://localhost:8983 --name signals -mode args --type text/csv --verbose $'id,value\n1,0.47'----