Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
Copilot commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2821519271
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -530,10 +549,24 @@ protected void runCloudExample(CommandLine cli) throws
Exception {
echo("\nWelcome to the SolrCloud example!\n");
-Scanner readInput = prompt ? new Scanner(userInput,
StandardCharsets.UTF_8) : null;
+Scanner readInput = null;
+if (usingPromptInputs) {
+ // Create a scanner from the provided prompts
+ String promptsValue = cli.getOptionValue(PROMPT_INPUTS_OPTION);
+ InputStream promptsStream =
+ new
java.io.ByteArrayInputStream(promptsValue.getBytes(StandardCharsets.UTF_8));
Review Comment:
Using `Scanner` with `useDelimiter(",")` will skip empty tokens (e.g.
`a,,b`), so users can’t "accept default" for a prompt in the middle while still
supplying later values. Consider parsing with a CSV-aware parser or `split(",",
-1)` to preserve empty fields so prompt positions stay aligned.
```suggestion
// Preserve empty fields so that users can "accept default" for a
prompt
// while still providing values for later prompts.
String[] promptTokens = promptsValue.split(",", -1);
for (int i = 0; i < promptTokens.length; i++) {
if (promptTokens[i].isEmpty()) {
// Use a single space so that Scanner produces a token, which the
// prompting logic can then trim() back to an empty string.
promptTokens[i] = " ";
}
}
String processedPromptsValue = String.join(",", promptTokens);
InputStream promptsStream =
new java.io.ByteArrayInputStream(
processedPromptsValue.getBytes(StandardCharsets.UTF_8));
```
##
solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc:
##
@@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment
to understand that the
`bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr
-m 512m`
+`-e ` or `--example `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with an example configuration.
+These examples are provided to help you get started faster with Solr
generally, or just try a specific feature.
++
+The available options are:
+
+* `cloud`: SolrCloud example
+* `techproducts`: Comprehensive example illustrating many of Solr's core
capabilities
+* `schemaless`: Schema-less example (schema is inferred from data during
indexing)
+* `films`: Example of starting with _default configset and adding explicit
fields dynamically
++
+See the section <> below for more details
on the example configurations.
++
+*Example*: `bin/solr start -e schemaless`
+
+`--no-prompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; accept all defaults when running examples that accept
user input.
++
+For example, when using the "cloud" example, an interactive session guides you
through several options for your SolrCloud cluster.
+If you want to accept all of the defaults, you can simply add the
`--no-prompt` option to your request.
++
+*Example*: `bin/solr start -e cloud --no-prompt`
+
+`--prompt-inputs `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; provide defaults in comma delimited format when
running examples that accept user input.
++
+For example, when using the "cloud" example, start a three node cluster on
specific ports:
Review Comment:
The `--prompt-inputs` description says "provide defaults", but this option
is actually supplying ordered *answers* to prompts (possibly overriding
defaults). Rewording this line would make the behavior clearer.
```suggestion
Don't prompt for input; instead supply ordered answers in comma-delimited
format when running examples that accept user input. These answers may override
the interactive defaults.
+
For example, when using the "cloud" example, you can answer the prompts
non-interactively to start a three node cluster on specific ports:
```
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPT_INPUTS_OPTION =
+ Option.builder()
+ .longOpt("prompt-inputs")
+ .hasArg()
+ .argName("VALUES")
Review Comment:
The PR title/description refer to `--prompts` / `--prompt=...`, but the
implementation introduces `--prompt-inputs`. Please align on a single flag name
across code, scripts, docs, tests, and changelog to avoid user confusion and
backport pain.
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-3919906923 I'm going to merge this as I need it for perf testing. We can iterate on it if it turns out not to be as useful as I hope it will be. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-3914115242 THanks all for comments! In the not too distant future I'm rolling out some tests that compare user-managed (standalone) to cloud, and cloud 1 shard to cloud 2 shard, and I expect to power that using these inputs for set up. For user-managed (standalone) to cloud, I think I need a `-e user-managed` setup that mimics what `-e cloud` does..? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2816475591
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
-String nextInput = s.nextLine();
+String nextInput;
+if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+echo(nextInput);
+ }
+} else {
+ // Reading from user input - use nextLine()
Review Comment:
I like seeing the lines because it helps me with debugging...I did
`defaultss` instead of `default` for a configset name and this let me see the
error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2816471317
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
-String nextInput = s.nextLine();
+String nextInput;
+if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+echo(nextInput);
Review Comment:
I tried with and without and it looks much better with! Plus you can debug
it. I was hoping that https://clig.dev/#interactivity would give some specific
advice on formatting, but it didn't hold any wisdom...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2816368527 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: I like your reasonining @rahulgoswami and can get behind it! `--prompt-inputs` it is! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808566035 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: The way I think about this...someone who is trying solr for the first time won't know that a `--no-prompt` or `--prompt-inputs` option exists unless they go looking, and when they do, both terms might sound equally _ambiguous_ at first in today's AI world. But then we already have a `--no-prompt` option and we are not going back. TLDR; It doesn't matter for new users. They should come around once they read the option description and then _hopefully_ both options make sense in conjunction. For those familiar with running solr and playing with examples, they are likely aware of the `--no-prompt` option already. And for them, `--prompt-inputs` should be a relatable extension. Let's go with this one? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2808616899
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
-String nextInput = s.nextLine();
+String nextInput;
+if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+echo(nextInput);
+ }
+} else {
+ // Reading from user input - use nextLine()
Review Comment:
Suggest moving `echo(prompt);` from the first line of the method to over
here. It would be fair to expect the CLI output for `--prompt-inputs` to be
similar to that of `--no-prompt`, aka without lines asking for inputs, since we
are already providing them in one shot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808566035 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: The way I think about this...someone who is trying solr for the first time won't know that a `--no-prompt` or `--prompt-inputs` option exists unless they go looking, and when they do, both terms might sound equally _misleading_ at first in today's AI world. But then we already have a `--no-prompt` option and we are not going back. TLDR; doesn't matter for new users. They should come around once they read the option description and then _hopefully_ both options make sense in conjunction. For those familiar with running solr and playing with examples, they are likely aware of the `--no-prompt` option already. And for them, `--prompt-inputs` should be a relatable extension. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808566035 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: The way I think about this...someone who is trying solr for the first time won't know that a `--no-prompt` or `--prompt-inputs` option exists unless they go looking, and when they do, both terms might sound equally _misleading_ at first in today's AI world. But then we already have a `--no-prompt` option and we are not going back. TLDR; doesn't matter for new users. They should come around once they read the option description and then _hopefully_ both options make sense in conjunction. For those familiar with running solr and playing with examples, they are likely aware of the `--no-prompt` option. And for them, `--prompt-inputs` should be a relatable extension. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808579952 ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompts "values" Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. Review Comment: Suggest documenting the order of inputs with an example --prompt-inputs "number _of_nodes, list_of_ports, collection_name,number_of_shards, number_of_replicas_per_shard, configuration_name" eg: --prompt-inputs "3,8983,8984,8985,gettingstarted,2,2,_default" ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompts "values" Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. Review Comment: Suggest documenting the order of inputs with an example --prompt-inputs "number _of_nodes, list_of_ports, collection_name, number_of_shards, number_of_replicas_per_shard, configuration_name" eg: --prompt-inputs "3,8983,8984,8985,gettingstarted,2,2,_default" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2808616899
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
-String nextInput = s.nextLine();
+String nextInput;
+if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+echo(nextInput);
+ }
+} else {
+ // Reading from user input - use nextLine()
Review Comment:
Suggest moving `echo(prompt);` from the first line of the method to over
here. It would be fair to expect the CLI output for --prompt-inputs to be
similar to --no-prompt, aka without lines asking for inputs, since we are
already providing it in one shot.
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -1121,9 +1155,24 @@ protected String prompt(Scanner s, String prompt) {
protected String prompt(Scanner s, String prompt, String defaultValue) {
echo(prompt);
-String nextInput = s.nextLine();
+String nextInput;
+if (usingPrompts) {
+ // Reading from prompts option - use next() instead of nextLine()
+ nextInput = s.hasNext() ? s.next() : null;
+ // Echo the value being used from prompts
+ if (nextInput != null) {
+echo(nextInput);
Review Comment:
Do we need to print here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808579952 ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompts "values" Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. Review Comment: Suggest documenting the order of inputs with an example --prompt-inputs "number _of_nodes,list_of_ports,collection_name,number_of_shards,number_of_replicas_per_shard,configuration_name" eg: --prompt-inputs "3,8983,8984,8985,gettingstarted,2,2,_default" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808579952 ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompts "values" Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. Review Comment: Suggest documenting the order of inputs with an example (--prompt-inputs "number _of_nodes,list_of_ports,collection_name,number_of_shards,number_of_replicas_per_shard,configuration_name") -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808579952 ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompts "values" Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. Review Comment: Suggest documenting the order of inputs (--prompt-inputs "number _of_nodes,list_of_ports,collection_name,number_of_shards,number_of_replicas_per_shard,configuration_name") -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808566035 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: The way I think about this...someone who is trying solr for the first time won't know that a `--no-prompt` or `--prompt-inputs` option exists unless they go looking, and when they do, both terms might sound equally _misleading_ at first in today's AI world. But then we already have a `--no-prompt` option and we are not going back. For those familiar with running solr and playing with examples, they are likely aware of the `--no-prompt` option. And for them, `--prompt-inputs` should be a relatable extension. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2808566035 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: The way I think about this...someone who is trying solr for the first time won't know that a --no-prompt or --prompt-inputs option exists unless they go looking, and when they do, both terms might sound equally _misleading_ at first in today's AI world. But then we already have a --no-prompt and we are not going back. For those familiar with running solr and playing with examples, they are likely aware of --no-prompt option. And for them, --prompt-inputs should be a relatable extension. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2803947121 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: though of course then we have `--no-prompts`...Now I come back to `--prompt-inputs`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2803942267 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: is "prompts" too overloaded in our AI tijes? How about `--example-inputs` to relate it to our examples? ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: is "prompts" too overloaded in our AI times? How about `--example-inputs` to relate it to our examples? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2802706751 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: `--user-inputs` could work. `--prompt-inputs` could be another candidate? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2802706751 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: `--user-inputs` could work. `--prompt-inputs` could work too ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2802704508
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
Passing a formatted json in CLI could quickly get tricky with the quote
escaping etc, especially on Windows. I like the properties file idea. Somewhat
like we have for basic auth in solr.in.sh and solr.in.cmd with
"SOLR_AUTHENTICATION_OPTS"
(https://solr.apache.org/guide/solr/latest/deployment-guide/basic-authentication-plugin.html#using-the-solr-control-script-with-basic-auth).
It can take the actual credentials as well as path to a file.
I am ok if the properties file enhancement comes as a second wave (one can
hope!) and we could still use it against the same --prompts param.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2802627214 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: `--user-inputs` could work. `--prompt-inputs` could also be a candidate? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2802531711
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
Passing a formatted json in CLI could quickly get tricky with the quote
escaping etc, especially on Windows. I like the properties file idea. Somewhat
like we have for basic auth in solr.in.sh and solr.in.cmd with
"SOLR_AUTHENTICATION_OPTS"
(https://solr.apache.org/guide/solr/latest/deployment-guide/basic-authentication-plugin.html#using-the-solr-control-script-with-basic-auth).
It can take the actual credentials as well as path to a file.
I am ok if the properties file enhancement comes as a second wave (one can
hope!) and we could still use it against the same --prompts param.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2802627214
##
solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc:
##
@@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment
to understand that the
`bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr
-m 512m`
+`-e ` or `--example `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with an example configuration.
+These examples are provided to help you get started faster with Solr
generally, or just try a specific feature.
++
+The available options are:
+
+* `cloud`: SolrCloud example
+* `techproducts`: Comprehensive example illustrating many of Solr's core
capabilities
+* `schemaless`: Schema-less example (schema is inferred from data during
indexing)
+* `films`: Example of starting with _default configset and adding explicit
fields dynamically
++
+See the section <> below for more details
on the example configurations.
++
+*Example*: `bin/solr start -e schemaless`
+
+`--no-prompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; accept all defaults when running examples that accept
user input.
++
+For example, when using the "cloud" example, an interactive session guides you
through several options for your SolrCloud cluster.
+If you want to accept all of the defaults, you can simply add the
`--no-prompt` option to your request.
++
+*Example*: `bin/solr start -e cloud --no-prompt`
+
+`--prompts `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; provide defaults in comma delimited format when
running examples that accept user input.
++
+For example, when using the "cloud" example, can start a three node cluster on
specific ports:
++
+*Example*: `bin/solr start -e cloud --prompts
3,9000,9001,9002,"mycollection",2,2,_defaults`
Review Comment:
`--user-inputs` could work. `--prompt-inputs` could also be a candidate?
##
solr/bin/solr.cmd:
##
@@ -399,6 +401,7 @@ IF "%1"=="-j" goto set_addl_jetty_config
IF "%1"=="--jettyconfig" goto set_addl_jetty_config
IF "%1"=="-y" goto set_noprompt
IF "%1"=="--no-prompt" goto set_noprompt
+IF "%1"=="--prompt"s goto set_prompts
Review Comment:
misplaced quote in "--prompts" breaks command
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
Passing a formatted json in CLI could quickly get tricky with the quote
escaping etc, especially on Windows. I like the properties file idea. Somewhat
like we have for basic auth in solr.in.sh and solr.in.cmd with
"SOLR_AUTHENTICATION_OPTS"
(https://solr.apache.org/guide/solr/latest/deployment-guide/basic-authentication-plugin.html#using-the-solr-control-script-with-basic-auth).
It can take the actual credentials as well as path to a file.
I am ok if the properties file enhancement comes as a second wave (one can
hope!) and we could still use it against the same --prompts param.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-3893693883 Maybe we should add a `@experimental` type notation t this as well... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2801320874 ## solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc: ## @@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment to understand that the `bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr -m 512m` +`-e ` or `--example `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Start Solr with an example configuration. +These examples are provided to help you get started faster with Solr generally, or just try a specific feature. ++ +The available options are: + +* `cloud`: SolrCloud example +* `techproducts`: Comprehensive example illustrating many of Solr's core capabilities +* `schemaless`: Schema-less example (schema is inferred from data during indexing) +* `films`: Example of starting with _default configset and adding explicit fields dynamically ++ +See the section <> below for more details on the example configurations. ++ +*Example*: `bin/solr start -e schemaless` + +`--no-prompt`:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; accept all defaults when running examples that accept user input. ++ +For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster. +If you want to accept all of the defaults, you can simply add the `--no-prompt` option to your request. ++ +*Example*: `bin/solr start -e cloud --no-prompt` + +`--prompts `:: ++ +[%autowidth,frame=none] +|=== +|Optional |Default: none +|=== ++ +Don't prompt for input; provide defaults in comma delimited format when running examples that accept user input. ++ +For example, when using the "cloud" example, can start a three node cluster on specific ports: ++ +*Example*: `bin/solr start -e cloud --prompts 3,9000,9001,9002,"mycollection",2,2,_defaults` Review Comment: what if we call it `--example-prompts`? Or `--example-inputs`? The docs say `--no-prompt` is for anything that takes user supplied prompts... `--user-inputs`?. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2801317998
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
yeah.. I worry about building something that is more code then the value...
and, the number of items changes depending on inputs. so if it's one node,
you are `1,8983,gettingstarted,2,2,_default`, and if it's four,
`4,9000,9001,9003,9002,"gettingstarted\",2,2,_default`. Now imagaine we add
some more prompts, then it will all change...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
janhoy commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2801146267
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
or could `--prompts` take a json `{"nodes":3,"port":"8983"}`? Or take name
of a properties file? It's an expert option so need not be beautiful
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2800929439
##
solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc:
##
@@ -277,6 +242,56 @@ To emphasize how the default settings work take a moment
to understand that the
`bin/solr start --host localhost -p 8983 --server-dir server --solr-home solr
-m 512m`
+`-e ` or `--example `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with an example configuration.
+These examples are provided to help you get started faster with Solr
generally, or just try a specific feature.
++
+The available options are:
+
+* `cloud`: SolrCloud example
+* `techproducts`: Comprehensive example illustrating many of Solr's core
capabilities
+* `schemaless`: Schema-less example (schema is inferred from data during
indexing)
+* `films`: Example of starting with _default configset and adding explicit
fields dynamically
++
+See the section <> below for more details
on the example configurations.
++
+*Example*: `bin/solr start -e schemaless`
+
+`--no-prompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; accept all defaults when running examples that accept
user input.
++
+For example, when using the "cloud" example, an interactive session guides you
through several options for your SolrCloud cluster.
+If you want to accept all of the defaults, you can simply add the
`--no-prompt` option to your request.
++
+*Example*: `bin/solr start -e cloud --no-prompt`
+
+`--prompts `::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Don't prompt for input; provide defaults in comma delimited format when
running examples that accept user input.
++
+For example, when using the "cloud" example, can start a three node cluster on
specific ports:
++
+*Example*: `bin/solr start -e cloud --prompts
3,9000,9001,9002,"mycollection",2,2,_defaults`
Review Comment:
Can we document the order ?
[number of nodes, comma separated port for each node, collection-name...]
##
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##
@@ -73,6 +73,16 @@ public class RunExampleTool extends ToolBase {
"Don't prompt for input; accept all defaults when running
examples that accept user input.")
.build();
+ private static final Option PROMPTS_OPTION =
+ Option.builder()
+ .longOpt("prompts")
+ .hasArg()
+ .argName("VALUES")
+ .desc(
+ "Provide comma-separated values for prompts. Same as --no-prompt
but uses provided values instead of defaults. "
+ + "Example: --prompts
3,8983,8984,8985,\"gettingstarted\",2,2,_default")
Review Comment:
Can we document the order here too like in the .adoc? I feel documenting
here might be more important, since if my usage pattern is any indicator of a
wider usage pattern, users might prefer the CLI options telling them the
expectation rather than them having to look up documentation for the same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
rahulgoswami commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-3893290508 Partial review since I haven't had a chance to try out the .cmd changes yet. I have to agree with @malliaridis assessment that there is no way one would remember this order. On the flip side, introducing a CLI parameter for each individual value feels like an overkill. I do feel this can be mitigated through documentation both in the .adoc and especially in the CLI options itself. May I also suggest changing --prompt to something like --default-cloud-options ? The current choice of name wasn't intuitive to me at all until I looked at the diff. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-388712 yeah, so there are some weasel words in the description of `--no-prompt` and `--prompts` about why they only work on cloud. And yes, agree that it could be better! Also, I agree that the pattern is brittle, but I don't want to add a million params, at least, not yet. I think of `--prompts` as kind of an expert level feature. For example, in a load testing script i am working on. I don't want to add too much to it till i know it adds value! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on code in PR #4127: URL: https://github.com/apache/solr/pull/4127#discussion_r2795461980 ## solr/bin/solr.cmd: ## @@ -341,8 +335,16 @@ goto err @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. +@echo -e/--example name Name of the example to run; available examples: +@echo cloud: SolrCloud example +@echo techproducts: Comprehensive example illustrating many of Solr's core capabilities +@echo schemaless: Schema-less example (schema is inferred from data during indexing) +@echo films: Example of starting with _default configset and defining explicit fields dynamically +@echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. +@echo --prompt Don't prompt for input; comma delimited list of inputs read when running examples that accept user input." Review Comment: thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
malliaridis commented on code in PR #4127:
URL: https://github.com/apache/solr/pull/4127#discussion_r2795127607
##
solr/bin/solr.cmd:
##
@@ -399,6 +401,7 @@ IF "%1"=="-j" goto set_addl_jetty_config
IF "%1"=="--jettyconfig" goto set_addl_jetty_config
IF "%1"=="-y" goto set_noprompt
IF "%1"=="--no-prompt" goto set_noprompt
+IF "%1"=="--prompt" goto set_prompt
Review Comment:
Same here `--prompts`
##
solr/bin/solr.cmd:
##
@@ -341,8 +335,16 @@ goto err
@echo you could pass: -j
"--include-jetty-dir=/etc/jetty/custom/server/"
@echo In most cases, you should wrap the additional parameters
in double quotes.
@echo.
+@echo -e/--example name Name of the example to run; available examples:
+@echo cloud: SolrCloud example
+@echo techproducts: Comprehensive example illustrating many of Solr's
core capabilities
+@echo schemaless: Schema-less example (schema is inferred from data
during indexing)
+@echo films: Example of starting with _default configset and
defining explicit fields dynamically
+@echo.
@echo -y/--no-prompt Don't prompt for input; accept all defaults when
running examples that accept user input
@echo.
+@echo --prompt Don't prompt for input; comma delimited list of
inputs read when running examples that accept user input."
Review Comment:
This should be probably `--prompts`
##
solr/bin/solr:
##
@@ -423,7 +417,15 @@ function print_usage() {
echo " you could pass: -j
\"--include-jetty-dir=/etc/jetty/custom/server/\""
echo " In most cases, you should wrap the
additional parameters in double quotes."
echo ""
-echo " -y/--no-promptDon't prompt for input; accept all defaults
when running examples that accept user input"
+echo " -e/--exampleName of the example to run; available
examples:"
+echo " cloud: SolrCloud example"
+echo " techproducts: Comprehensive example illustrating many of
Solr's core capabilities"
+echo " schemaless: Schema-less example (schema is inferred
from data during indexing)"
+echo " films: Example of starting with _default
configset and adding explicit fields dynamically"
+echo ""
+echo " -y/--no-promptDon't prompt for input; accept all defaults
when running examples that accept user input."
+echo ""
+echo " --prompts Don't prompt for input; comma delimited
list of inputs read when running examples that accept user input."
Review Comment:
This line seems malformed, the output is:
> -y/--no-prompt Don't prompt for input; accept all defaults when running
examples that accept user input
>
> The system cannot find the file specified.
>
> --verbose and -q/--quiet Verbose or quiet logging. Sets default log
level to DEBUG or WARN instead of INFO
It fails because of ``, write it without the angle brackets
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts [solr]
epugh commented on PR #4127: URL: https://github.com/apache/solr/pull/4127#issuecomment-3885261930 @rahulgoswami could you check out the `bin/solr.cmd` changes? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
