Skip to content

Apache Lucene open-source search software

SOLR-6866: schemaless example should create core/collection named gettingstarted

Timothy Potter27f8a4649d51
diff --git a/solr/bin/solr b/solr/bin/solr
index b8e9d90f2f3..1af990ae18d 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1196,14 +1196,21 @@ if [ "$EXAMPLE" != "cloud" ]; then
# create the core/collection for the requested example after launching Solr
if [[ "$EXAMPLE" == "schemaless" || "$EXAMPLE" == "techproducts" ]]; then
+
+ if [ "$EXAMPLE" == "schemaless" ]; then
+ EXAMPLE_NAME=gettingstarted
+ else
+ EXAMPLE_NAME=$EXAMPLE
+ fi
+
if [ "$SOLR_MODE" == "solrcloud" ]; then
- run_tool create_collection -name $EXAMPLE -shards 1 -replicationFactor 1 \
+ run_tool create_collection -name $EXAMPLE_NAME -shards 1 -replicationFactor 1 \
-config $EXAMPLE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl http://localhost:$SOLR_PORT/solr
if [ $? -ne 0 ]; then
exit 1
fi
else
- run_tool create_core -name $EXAMPLE -solrUrl http://localhost:$SOLR_PORT/solr \
+ run_tool create_core -name $EXAMPLE_NAME -solrUrl http://localhost:$SOLR_PORT/solr \
-config $EXAMPLE_CONFIGSET -configsetsDir $SOLR_TIP/server/solr/configsets
if [ $? -ne 0 ]; then
exit 1
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 8c670e123fd..53413db0ef1 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -715,8 +715,10 @@ IF "%FG%"=="1" (
)
+set EXAMPLE_NAME=%EXAMPLE%
set CREATE_EXAMPLE_CONFIG=
IF "%EXAMPLE%"=="schemaless" (
+ set EXAMPLE_NAME=gettingstarted
set CREATE_EXAMPLE_CONFIG=data_driven_schema_configs
)
IF "%EXAMPLE%"=="techproducts" (
@@ -728,12 +730,12 @@ IF NOT "!CREATE_EXAMPLE_CONFIG!"=="" (
IF "%SOLR_MODE%"=="solrcloud" (
"%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
- org.apache.solr.util.SolrCLI create_collection -name !EXAMPLE! -shards 1 -replicationFactor 1 ^
+ org.apache.solr.util.SolrCLI create_collection -name !EXAMPLE_NAME! -shards 1 -replicationFactor 1 ^
-config !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -solrUrl http://localhost:%SOLR_PORT%/solr
) ELSE (
"%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
- org.apache.solr.util.SolrCLI create_core -name !EXAMPLE! -solrUrl http://localhost:%SOLR_PORT%/solr ^
+ org.apache.solr.util.SolrCLI create_core -name !EXAMPLE_NAME! -solrUrl http://localhost:%SOLR_PORT%/solr ^
-config !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets"
)
)