This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 99a9b10feb0 SOLR-17315: Fix message formatting (#2511)
99a9b10feb0 is described below
commit 99a9b10feb0a704dcda802a8e53a7e45be39cbd8
Author: Eric Pugh <[email protected]>
AuthorDate: Sun Jun 9 15:11:53 2024 -0400
SOLR-17315: Fix message formatting (#2511)
---
solr/CHANGES.txt | 2 ++
solr/core/src/java/org/apache/solr/cli/CreateTool.java | 9 +++++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9dd14ff6b99..42748426ddd 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -150,6 +150,8 @@ Bug Fixes
* SOLR-17317: v2 APIs no longer return the incorrect content-type when
'wt=json' specified (Jason Gerlowski)
+* SOLR-17315: Fixed "next step" example urls generated by bin/solr create
commands to use the newly created collection/core name. (Eric Pugh)
+
Dependency Upgrades
---------------------
(No changes)
diff --git a/solr/core/src/java/org/apache/solr/cli/CreateTool.java
b/solr/core/src/java/org/apache/solr/cli/CreateTool.java
index 36a3247e7ec..c1065dfdc88 100644
--- a/solr/core/src/java/org/apache/solr/cli/CreateTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/CreateTool.java
@@ -345,20 +345,21 @@ public class CreateTool extends ToolBase {
if (confDirectoryName.equals("_default")
&& (confName.equals("") || confName.equals("_default"))) {
- final String collectionName = cli.getOptionValue("collection");
+ final String collectionName = cli.getOptionValue("name");
final String solrUrl = cli.getOptionValue("solrUrl",
SolrCLI.getDefaultSolrUrl());
final String curlCommand =
String.format(
Locale.ROOT,
- "curl %s/%s/config -d "
+ "curl %s/solr/%s/config -d "
+ "'{\"set-user-property\":
{\"update.autoCreateFields\":\"false\"}}'",
solrUrl,
collectionName);
final String configCommand =
String.format(
Locale.ROOT,
- "bin/solr config -c %s -p 8983 -action set-user-property
-property update.autoCreateFields -value false",
- collectionName);
+ "bin/solr config -c %s -solrUrl %s -action set-user-property
-property update.autoCreateFields -value false",
+ collectionName,
+ solrUrl);
echo(
"WARNING: Using _default configset. Data driven schema functionality
is enabled by default, which is");
echo(" NOT RECOMMENDED for production use.");