From ac9e3d06050b4c8993b8b57b8b56ac71b8d0fd0b Mon Sep 17 00:00:00 2001 From: Serhiy Bzhezytskyy Date: Sun, 20 Sep 2026 18:10:27 +0300 Subject: [PATCH 1/2] SOLR-18468: Rename --prompt-inputs to --session-inputs bin/solr already has --prompt under auth enable and --no-prompt under start -e; adding --prompt-inputs made three differently-shaped --prompt* flags on one script. The interactive setup flow is already called an 'interactive session' throughout the ref guide, so --session-inputs reuses that term instead of adding a new overload. The flag has been unreleased for its whole 7-month life (main only), so this is a clean rename with no deprecated alias. --- changelog/unreleased/SOLR-18118.yml | 2 +- solr/bin/solr | 10 ++-- solr/bin/solr.cmd | 6 +-- .../org/apache/solr/cli/RunExampleTool.java | 49 ++++++++++--------- .../solr/cli/TestSolrCLIRunExample.java | 16 +++--- .../pages/solr-control-script-reference.adoc | 8 +-- 6 files changed, 46 insertions(+), 45 deletions(-) diff --git a/changelog/unreleased/SOLR-18118.yml b/changelog/unreleased/SOLR-18118.yml index e3d703091ff7..3f711e12474b 100644 --- a/changelog/unreleased/SOLR-18118.yml +++ b/changelog/unreleased/SOLR-18118.yml @@ -1,5 +1,5 @@ # See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc -title: Script creating a cluster using bin/solr start -e cloud with --prompt-inputs option. +title: Script creating a cluster using bin/solr start -e cloud with --session-inputs option. type: added # added, changed, fixed, deprecated, removed, dependency_update, security, other authors: - name: Eric Pugh diff --git a/solr/bin/solr b/solr/bin/solr index e61808d080c4..5f0b2dde8a19 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -425,7 +425,7 @@ function print_usage() { echo "" echo " -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input." echo "" - echo " --prompt-inputs Don't prompt for input; comma delimited list of inputs read when running examples that accept user input." + echo " --session-inputs Don't prompt for input; comma delimited list of inputs read when running examples that accept user input." echo "" echo " --force If attempting to start Solr as the root user, the script will exit with a warning that running Solr as \"root\" can cause problems." echo " It is possible to override this warning with the '--force' parameter." @@ -835,14 +835,14 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("--no-prompt") shift ;; - --prompt-inputs) + --session-inputs) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then - print_usage "$SCRIPT_CMD" "Prompt values are required when using the $1 option!" + print_usage "$SCRIPT_CMD" "Session input values are required when using the $1 option!" exit 1 fi - PASS_TO_RUN_EXAMPLE+=("--prompt-inputs" "$2") + PASS_TO_RUN_EXAMPLE+=("--session-inputs" "$2") shift 2 - ;; + ;; --verbose) verbose=true SOLR_LOG_LEVEL=DEBUG diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 743d8fb7cdc3..3f530f351366 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -343,7 +343,7 @@ goto err @echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. -@echo --prompt-inputs values Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. +@echo --session-inputs values Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. @echo. @echo --verbose and -q/--quiet Verbose or quiet logging. Sets default log level to DEBUG or WARN instead of INFO @echo. @@ -404,7 +404,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-inputs" goto set_prompt_inputs +IF "%1"=="--session-inputs" goto set_prompt_inputs REM Skip stop arg parsing if not stop command IF NOT "%SCRIPT_CMD%"=="stop" goto parse_general_args @@ -716,7 +716,7 @@ SHIFT goto parse_args :set_prompt_inputs -set "PASS_TO_RUN_EXAMPLE=--prompt-inputs %~2 !PASS_TO_RUN_EXAMPLE!" +set "PASS_TO_RUN_EXAMPLE=--session-inputs %~2 !PASS_TO_RUN_EXAMPLE!" SHIFT SHIFT diff --git a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java index 6c0f07b78f71..4705cc00c716 100644 --- a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java +++ b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java @@ -73,14 +73,14 @@ public class RunExampleTool extends ToolBase { "Don't prompt for input; accept all defaults when running examples that accept user input.") .get(); - private static final Option PROMPT_INPUTS_OPTION = + private static final Option SESSION_INPUTS_OPTION = Option.builder() - .longOpt("prompt-inputs") + .longOpt("session-inputs") .hasArg() .argName("VALUES") .desc( - "Provide comma-separated values for prompts. Same as --no-prompt but uses provided values instead of defaults. " - + "Example: --prompt-inputs 3,8983,8984,8985,\"gettingstarted\",2,2,_default") + "Provide comma-separated values for the interactive session's prompts. Same as --no-prompt but uses provided values instead of defaults. " + + "Example: --session-inputs 3,8983,8984,8985,\"gettingstarted\",2,2,_default") .build(); private static final Option EXAMPLE_OPTION = @@ -186,7 +186,7 @@ public class RunExampleTool extends ToolBase { protected Path exampleDir; protected Path solrHomeDir; protected String urlScheme; - private boolean usingPromptInputs = false; + private boolean usingSessionInputs = false; /** * Parameters consumed when starting a single Solr node via the bin/solr script, common to all @@ -214,12 +214,13 @@ record RunExampleParams(boolean isCloudMode, String zkHost, int port, StartSolrP /** * Parameters for running the multi-node cloud example, independent of the command line parser. * - * @param promptInputs comma-separated prompt answers, or null when prompting interactively + * @param sessionInputs comma-separated session answers, or null to run the interactive session + * instead * @param zkHost ZooKeeper connection string resolved from option or sysprop, or null * @param basePort first node port; remaining nodes use basePort+1..+3 unless prompted otherwise */ record CloudExampleParams( - boolean noPrompt, String promptInputs, String zkHost, int basePort, StartSolrParams start) {} + boolean noPrompt, String sessionInputs, String zkHost, int basePort, StartSolrParams start) {} /** Default constructor used by the framework when running as a command-line application. */ public RunExampleTool(ToolRuntime runtime) { @@ -241,7 +242,7 @@ public String getName() { public Options getOptions() { return super.getOptions() .addOption(NO_PROMPT_OPTION) - .addOption(PROMPT_INPUTS_OPTION) + .addOption(SESSION_INPUTS_OPTION) .addOption(EXAMPLE_OPTION) .addOption(SCRIPT_OPTION) .addOption(SERVER_DIR_OPTION) @@ -259,10 +260,10 @@ public Options getOptions() { @Override public void runImpl(CommandLine cli) throws Exception { - if (cli.hasOption(NO_PROMPT_OPTION) && cli.hasOption(PROMPT_INPUTS_OPTION)) { + if (cli.hasOption(NO_PROMPT_OPTION) && cli.hasOption(SESSION_INPUTS_OPTION)) { throw new IllegalArgumentException( - "Cannot use both --no-prompt and --prompt-inputs options together. " - + "Use --no-prompt to accept defaults, or --prompt-inputs to provide specific values."); + "Cannot use both --no-prompt and --session-inputs options together. " + + "Use --no-prompt to accept defaults, or --session-inputs to provide specific values."); } this.urlScheme = cli.getOptionValue(URL_SCHEME_OPTION, "http"); @@ -315,7 +316,7 @@ public void runImpl(CommandLine cli) throws Exception { runCloudExample( new CloudExampleParams( cli.hasOption(NO_PROMPT_OPTION), - cli.getOptionValue(PROMPT_INPUTS_OPTION), + cli.getOptionValue(SESSION_INPUTS_OPTION), zkHost, port, startParams)); @@ -608,7 +609,7 @@ void runExample(RunExampleParams params) throws Exception { void runCloudExample(CloudExampleParams params) throws Exception { - usingPromptInputs = params.promptInputs() != null; + usingSessionInputs = params.sessionInputs() != null; boolean prompt = !params.noPrompt(); int numNodes = 2; int[] cloudPorts = new int[] {8983, 7574, 8984, 7575}; @@ -622,20 +623,20 @@ void runCloudExample(CloudExampleParams params) throws Exception { echo("\nWelcome to the SolrCloud example!\n"); Scanner readInput = null; - if (usingPromptInputs) { - // Create a scanner from the provided prompts - String promptsValue = params.promptInputs(); - InputStream promptsStream = - new ByteArrayInputStream(promptsValue.getBytes(StandardCharsets.UTF_8)); - readInput = new Scanner(promptsStream, StandardCharsets.UTF_8); + if (usingSessionInputs) { + // Create a scanner from the provided session inputs + String sessionInputsValue = params.sessionInputs(); + InputStream sessionInputsStream = + new ByteArrayInputStream(sessionInputsValue.getBytes(StandardCharsets.UTF_8)); + readInput = new Scanner(sessionInputsStream, StandardCharsets.UTF_8); readInput.useDelimiter(","); - prompt = true; // Enable prompting code path, but reading from prompts instead of user + prompt = true; // Enable prompting code path, but reading from session inputs instead of user } else if (prompt) { readInput = new Scanner(userInput, StandardCharsets.UTF_8); } if (prompt) { - if (!usingPromptInputs) { + if (!usingSessionInputs) { echo( "This interactive session will help you launch a SolrCloud cluster on your local workstation."); } @@ -1225,10 +1226,10 @@ protected String prompt(Scanner s, String prompt) { protected String prompt(Scanner s, String prompt, String defaultValue) { echo(prompt); String nextInput; - if (usingPromptInputs) { - // Reading from prompts option - use next() instead of nextLine() + if (usingSessionInputs) { + // Reading from session-inputs option - use next() instead of nextLine() nextInput = s.hasNext() ? s.next() : null; - // Echo the value being used from prompts + // Echo the value being used from session inputs if (nextInput != null) { echo(nextInput); } diff --git a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java index 2e2157878ae8..98be057ced62 100644 --- a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java +++ b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java @@ -522,11 +522,11 @@ public void testInteractiveSolrCloudExample() throws Exception { } /** - * Test the --prompt-inputs option that allows providing all prompt values as a comma-separated + * Test the --session-inputs option that allows providing all prompt values as a comma-separated * string without requiring interactive input. */ @Test - public void testSolrCloudExampleWithPrompts() throws Exception { + public void testSolrCloudExampleWithSessionInputs() throws Exception { Path solrHomeDir = ExternalPaths.SERVER_HOME; if (!Files.isDirectory(solrHomeDir)) fail(solrHomeDir + " not found and is required to run this test!"); @@ -539,11 +539,11 @@ public void testSolrCloudExampleWithPrompts() throws Exception { bindPort = socket.getLocalPort(); } - String collectionName = "testCloudExampleWithPrompts"; + String collectionName = "testCloudExampleWithSessionInputs"; - // Provide all prompt values via --prompt-inputs option: + // Provide all session values via --session-inputs option: // numNodes, port1, collectionName, numShards, replicationFactor, configName - String promptsValue = "1," + bindPort + ",\"" + collectionName + "\",2,2,_default"; + String sessionInputsValue = "1," + bindPort + ",\"" + collectionName + "\",2,2,_default"; String[] toolArgs = new String[] { @@ -553,8 +553,8 @@ public void testSolrCloudExampleWithPrompts() throws Exception { solrServerDir.toString(), "--example-dir", solrExampleDir.toString(), - "--prompt-inputs", - promptsValue + "--session-inputs", + sessionInputsValue }; // capture tool output to stdout @@ -581,7 +581,7 @@ public void testSolrCloudExampleWithPrompts() throws Exception { String solrUrl = "http://localhost:" + bindPort + "/solr"; if (!CLIUtils.safeCheckCollectionExists(solrUrl, collectionName, null)) { fail( - "After running Solr cloud example with --prompt-inputs, test collection '" + "After running Solr cloud example with --session-inputs, test collection '" + collectionName + "' not found in Solr at: " + solrUrl 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 94611440f022..11ed6ed230a3 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 @@ -277,7 +277,7 @@ If you want to accept all of the defaults, you can simply add the `--no-prompt` + *Example*: `bin/solr start -e cloud --no-prompt` -`--prompt-inputs `:: +`--session-inputs `:: + [%autowidth,frame=none] |=== @@ -286,11 +286,11 @@ If you want to accept all of the defaults, you can simply add the `--no-prompt` + Don't prompt for input; instead supply ordered answers in comma delimited format when running examples that accept input. + -For example, when using the "cloud" example, you can answer the prompts non-interactively to start a three node cluster on specific ports: +For example, when using the "cloud" example, you can answer the interactive session's questions non-interactively to start a three node cluster on specific ports: + -*Example*: `bin/solr start -e cloud --prompt-inputs 3,9000,9001,9002,"mycollection",2,2,_default` +*Example*: `bin/solr start -e cloud --session-inputs 3,9000,9001,9002,"mycollection",2,2,_default` -On Windows please wrap the prompts value in double quotes to preserve the comma delimited format. +On Windows please wrap the session-inputs value in double quotes to preserve the comma delimited format. It is not necessary to define all of the options when starting if the defaults are fine for your needs. From 18be46facc723b358a3da6ab51a0be18ec74ae71 Mon Sep 17 00:00:00 2001 From: Serhiy Bzhezytskyy Date: Thu, 1 Oct 2026 16:43:18 +0300 Subject: [PATCH 2/2] SOLR-18468: Use --script-inputs for the answers that bin/solr start -e takes --session-inputs was judged too generic. The guide calls bin/solr the Solr Control Script and run_example already takes --script for its path, so --script-inputs reads as the inputs for the script, and other bin/solr tools can reuse it. The flag has never been released, so the rename carries no alias; the unreleased changelog title for SOLR-18118 changes with it. --- changelog/unreleased/SOLR-18118.yml | 2 +- solr/bin/solr | 6 +-- solr/bin/solr.cmd | 8 ++-- .../org/apache/solr/cli/RunExampleTool.java | 48 +++++++++---------- .../solr/cli/TestSolrCLIRunExample.java | 16 +++---- .../pages/solr-control-script-reference.adoc | 6 +-- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/changelog/unreleased/SOLR-18118.yml b/changelog/unreleased/SOLR-18118.yml index 3f711e12474b..5c4bb3f200bd 100644 --- a/changelog/unreleased/SOLR-18118.yml +++ b/changelog/unreleased/SOLR-18118.yml @@ -1,5 +1,5 @@ # See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc -title: Script creating a cluster using bin/solr start -e cloud with --session-inputs option. +title: Script creating a cluster using bin/solr start -e cloud with --script-inputs option. type: added # added, changed, fixed, deprecated, removed, dependency_update, security, other authors: - name: Eric Pugh diff --git a/solr/bin/solr b/solr/bin/solr index 5f0b2dde8a19..4d05cb09d456 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -425,7 +425,7 @@ function print_usage() { echo "" echo " -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input." echo "" - echo " --session-inputs Don't prompt for input; comma delimited list of inputs read when running examples that accept user input." + echo " --script-inputs Don't prompt for input; comma delimited list of inputs read when running examples that accept user input." echo "" echo " --force If attempting to start Solr as the root user, the script will exit with a warning that running Solr as \"root\" can cause problems." echo " It is possible to override this warning with the '--force' parameter." @@ -835,12 +835,12 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("--no-prompt") shift ;; - --session-inputs) + --script-inputs) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Session input values are required when using the $1 option!" exit 1 fi - PASS_TO_RUN_EXAMPLE+=("--session-inputs" "$2") + PASS_TO_RUN_EXAMPLE+=("--script-inputs" "$2") shift 2 ;; --verbose) diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 3f530f351366..674881619952 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -343,7 +343,7 @@ goto err @echo. @echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. -@echo --session-inputs values Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. +@echo --script-inputs values Don't prompt for input; comma delimited list of inputs read when running examples that accept user input. @echo. @echo --verbose and -q/--quiet Verbose or quiet logging. Sets default log level to DEBUG or WARN instead of INFO @echo. @@ -404,7 +404,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"=="--session-inputs" goto set_prompt_inputs +IF "%1"=="--script-inputs" goto set_script_inputs REM Skip stop arg parsing if not stop command IF NOT "%SCRIPT_CMD%"=="stop" goto parse_general_args @@ -715,8 +715,8 @@ set "PASS_TO_RUN_EXAMPLE=--no-prompt !PASS_TO_RUN_EXAMPLE!" SHIFT goto parse_args -:set_prompt_inputs -set "PASS_TO_RUN_EXAMPLE=--session-inputs %~2 !PASS_TO_RUN_EXAMPLE!" +:set_script_inputs +set "PASS_TO_RUN_EXAMPLE=--script-inputs %~2 !PASS_TO_RUN_EXAMPLE!" SHIFT SHIFT diff --git a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java index 4705cc00c716..239a7a163519 100644 --- a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java +++ b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java @@ -73,14 +73,14 @@ public class RunExampleTool extends ToolBase { "Don't prompt for input; accept all defaults when running examples that accept user input.") .get(); - private static final Option SESSION_INPUTS_OPTION = + private static final Option SCRIPT_INPUTS_OPTION = Option.builder() - .longOpt("session-inputs") + .longOpt("script-inputs") .hasArg() .argName("VALUES") .desc( "Provide comma-separated values for the interactive session's prompts. Same as --no-prompt but uses provided values instead of defaults. " - + "Example: --session-inputs 3,8983,8984,8985,\"gettingstarted\",2,2,_default") + + "Example: --script-inputs 3,8983,8984,8985,\"gettingstarted\",2,2,_default") .build(); private static final Option EXAMPLE_OPTION = @@ -186,7 +186,7 @@ public class RunExampleTool extends ToolBase { protected Path exampleDir; protected Path solrHomeDir; protected String urlScheme; - private boolean usingSessionInputs = false; + private boolean usingScriptInputs = false; /** * Parameters consumed when starting a single Solr node via the bin/solr script, common to all @@ -214,13 +214,13 @@ record RunExampleParams(boolean isCloudMode, String zkHost, int port, StartSolrP /** * Parameters for running the multi-node cloud example, independent of the command line parser. * - * @param sessionInputs comma-separated session answers, or null to run the interactive session - * instead + * @param scriptInputs comma-separated answers to the example's prompts, or null to run the + * interactive session instead * @param zkHost ZooKeeper connection string resolved from option or sysprop, or null * @param basePort first node port; remaining nodes use basePort+1..+3 unless prompted otherwise */ record CloudExampleParams( - boolean noPrompt, String sessionInputs, String zkHost, int basePort, StartSolrParams start) {} + boolean noPrompt, String scriptInputs, String zkHost, int basePort, StartSolrParams start) {} /** Default constructor used by the framework when running as a command-line application. */ public RunExampleTool(ToolRuntime runtime) { @@ -242,7 +242,7 @@ public String getName() { public Options getOptions() { return super.getOptions() .addOption(NO_PROMPT_OPTION) - .addOption(SESSION_INPUTS_OPTION) + .addOption(SCRIPT_INPUTS_OPTION) .addOption(EXAMPLE_OPTION) .addOption(SCRIPT_OPTION) .addOption(SERVER_DIR_OPTION) @@ -260,10 +260,10 @@ public Options getOptions() { @Override public void runImpl(CommandLine cli) throws Exception { - if (cli.hasOption(NO_PROMPT_OPTION) && cli.hasOption(SESSION_INPUTS_OPTION)) { + if (cli.hasOption(NO_PROMPT_OPTION) && cli.hasOption(SCRIPT_INPUTS_OPTION)) { throw new IllegalArgumentException( - "Cannot use both --no-prompt and --session-inputs options together. " - + "Use --no-prompt to accept defaults, or --session-inputs to provide specific values."); + "Cannot use both --no-prompt and --script-inputs options together. " + + "Use --no-prompt to accept defaults, or --script-inputs to provide specific values."); } this.urlScheme = cli.getOptionValue(URL_SCHEME_OPTION, "http"); @@ -316,7 +316,7 @@ public void runImpl(CommandLine cli) throws Exception { runCloudExample( new CloudExampleParams( cli.hasOption(NO_PROMPT_OPTION), - cli.getOptionValue(SESSION_INPUTS_OPTION), + cli.getOptionValue(SCRIPT_INPUTS_OPTION), zkHost, port, startParams)); @@ -609,7 +609,7 @@ void runExample(RunExampleParams params) throws Exception { void runCloudExample(CloudExampleParams params) throws Exception { - usingSessionInputs = params.sessionInputs() != null; + usingScriptInputs = params.scriptInputs() != null; boolean prompt = !params.noPrompt(); int numNodes = 2; int[] cloudPorts = new int[] {8983, 7574, 8984, 7575}; @@ -623,20 +623,20 @@ void runCloudExample(CloudExampleParams params) throws Exception { echo("\nWelcome to the SolrCloud example!\n"); Scanner readInput = null; - if (usingSessionInputs) { - // Create a scanner from the provided session inputs - String sessionInputsValue = params.sessionInputs(); - InputStream sessionInputsStream = - new ByteArrayInputStream(sessionInputsValue.getBytes(StandardCharsets.UTF_8)); - readInput = new Scanner(sessionInputsStream, StandardCharsets.UTF_8); + if (usingScriptInputs) { + // Create a scanner from the provided script inputs + String scriptInputsValue = params.scriptInputs(); + InputStream scriptInputsStream = + new ByteArrayInputStream(scriptInputsValue.getBytes(StandardCharsets.UTF_8)); + readInput = new Scanner(scriptInputsStream, StandardCharsets.UTF_8); readInput.useDelimiter(","); - prompt = true; // Enable prompting code path, but reading from session inputs instead of user + prompt = true; // Enable prompting code path, but reading from script inputs instead of user } else if (prompt) { readInput = new Scanner(userInput, StandardCharsets.UTF_8); } if (prompt) { - if (!usingSessionInputs) { + if (!usingScriptInputs) { echo( "This interactive session will help you launch a SolrCloud cluster on your local workstation."); } @@ -1226,10 +1226,10 @@ protected String prompt(Scanner s, String prompt) { protected String prompt(Scanner s, String prompt, String defaultValue) { echo(prompt); String nextInput; - if (usingSessionInputs) { - // Reading from session-inputs option - use next() instead of nextLine() + if (usingScriptInputs) { + // Reading from script-inputs option - use next() instead of nextLine() nextInput = s.hasNext() ? s.next() : null; - // Echo the value being used from session inputs + // Echo the value being used from script inputs if (nextInput != null) { echo(nextInput); } diff --git a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java index 98be057ced62..f290115486c1 100644 --- a/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java +++ b/solr/core/src/test/org/apache/solr/cli/TestSolrCLIRunExample.java @@ -522,11 +522,11 @@ public void testInteractiveSolrCloudExample() throws Exception { } /** - * Test the --session-inputs option that allows providing all prompt values as a comma-separated + * Test the --script-inputs option that allows providing all prompt values as a comma-separated * string without requiring interactive input. */ @Test - public void testSolrCloudExampleWithSessionInputs() throws Exception { + public void testSolrCloudExampleWithScriptInputs() throws Exception { Path solrHomeDir = ExternalPaths.SERVER_HOME; if (!Files.isDirectory(solrHomeDir)) fail(solrHomeDir + " not found and is required to run this test!"); @@ -539,11 +539,11 @@ public void testSolrCloudExampleWithSessionInputs() throws Exception { bindPort = socket.getLocalPort(); } - String collectionName = "testCloudExampleWithSessionInputs"; + String collectionName = "testCloudExampleWithScriptInputs"; - // Provide all session values via --session-inputs option: + // Provide all prompt values via --script-inputs option: // numNodes, port1, collectionName, numShards, replicationFactor, configName - String sessionInputsValue = "1," + bindPort + ",\"" + collectionName + "\",2,2,_default"; + String scriptInputsValue = "1," + bindPort + ",\"" + collectionName + "\",2,2,_default"; String[] toolArgs = new String[] { @@ -553,8 +553,8 @@ public void testSolrCloudExampleWithSessionInputs() throws Exception { solrServerDir.toString(), "--example-dir", solrExampleDir.toString(), - "--session-inputs", - sessionInputsValue + "--script-inputs", + scriptInputsValue }; // capture tool output to stdout @@ -581,7 +581,7 @@ public void testSolrCloudExampleWithSessionInputs() throws Exception { String solrUrl = "http://localhost:" + bindPort + "/solr"; if (!CLIUtils.safeCheckCollectionExists(solrUrl, collectionName, null)) { fail( - "After running Solr cloud example with --session-inputs, test collection '" + "After running Solr cloud example with --script-inputs, test collection '" + collectionName + "' not found in Solr at: " + solrUrl 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 11ed6ed230a3..c12dd02f4cff 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 @@ -277,7 +277,7 @@ If you want to accept all of the defaults, you can simply add the `--no-prompt` + *Example*: `bin/solr start -e cloud --no-prompt` -`--session-inputs `:: +`--script-inputs `:: + [%autowidth,frame=none] |=== @@ -288,9 +288,9 @@ Don't prompt for input; instead supply ordered answers in comma delimited format + For example, when using the "cloud" example, you can answer the interactive session's questions non-interactively to start a three node cluster on specific ports: + -*Example*: `bin/solr start -e cloud --session-inputs 3,9000,9001,9002,"mycollection",2,2,_default` +*Example*: `bin/solr start -e cloud --script-inputs 3,9000,9001,9002,"mycollection",2,2,_default` -On Windows please wrap the session-inputs value in double quotes to preserve the comma delimited format. +On Windows please wrap the script-inputs value in double quotes to preserve the comma delimited format. It is not necessary to define all of the options when starting if the defaults are fine for your needs.