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 d00f96524f1 SOLR-17526: Deprecate --out in favour of --verbose. (#2812)
d00f96524f1 is described below
commit d00f96524f1bd4988990804243c7b593d925e253
Author: Eric Pugh <[email protected]>
AuthorDate: Tue Oct 29 11:19:05 2024 -0400
SOLR-17526: Deprecate --out in favour of --verbose. (#2812)
(cherry picked from commit dd6f2152c236d301f84e328b84e21ac89b2c9145)
---
solr/core/src/java/org/apache/solr/cli/PostTool.java | 11 ++++++++++-
solr/packaging/test/test_post.bats | 12 ++++++++++++
.../modules/indexing-guide/pages/indexing-with-tika.adoc | 2 +-
.../modules/indexing-guide/pages/post-tool.adoc | 11 +++++------
4 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/cli/PostTool.java
b/solr/core/src/java/org/apache/solr/cli/PostTool.java
index 53014750b75..d8e066db0de 100644
--- a/solr/core/src/java/org/apache/solr/cli/PostTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/PostTool.java
@@ -282,6 +282,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(),
@@ -381,7 +387,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.bats
index bd78feb9d81..891fb3f4be3 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_solr
assert_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.adoc
index 14b26ed556d..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=ruby&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 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 0561c9b2c41..dc0d4493408 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
@@ -44,8 +44,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:
@@ -64,7 +64,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
@@ -180,11 +179,11 @@ $ bin/solr post --mode web -c gettingstarted --recursive
1 --delay 1 https://sol
=== Standard Input as Source for Indexing
You 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
@@ -193,5 +192,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'
----