You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2017/06/25 21:23:48 UTC

[12/12] lucene-solr:jira/solr-10574: SOLR-10574: Making _default as the default configset

SOLR-10574: Making _default as the default configset


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e6037646
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e6037646
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e6037646

Branch: refs/heads/jira/solr-10574
Commit: e603764608f6206159601ec62cf75bdb059236f5
Parents: ed844ac
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Mon Jun 26 02:11:45 2017 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Mon Jun 26 02:11:45 2017 +0530

----------------------------------------------------------------------
 solr/bin/solr                                         | 12 +++++-------
 solr/bin/solr.cmd                                     | 14 ++++++--------
 solr/core/src/java/org/apache/solr/util/SolrCLI.java  |  8 ++++----
 .../org/apache/solr/cloud/SolrCloudExampleTest.java   | 11 ++++++-----
 .../org/apache/solr/util/TestSolrCLIRunExample.java   |  2 +-
 solr/server/README.txt                                | 11 +++++------
 .../org/apache/solr/common/cloud/ZkConfigManager.java |  2 +-
 .../solr/client/solrj/SolrSchemalessExampleTest.java  |  2 +-
 .../src/java/org/apache/solr/util/ExternalPaths.java  |  4 ++--
 9 files changed, 31 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/bin/solr
----------------------------------------------------------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index cd50828..fff11ed 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -419,12 +419,11 @@ function print_usage() {
     echo ""
     echo "  -d <confdir>  Configuration directory to copy when creating the new core, built-in options are:"
     echo ""
-    echo "      basic_configs: Minimal Solr configuration"
-    echo "      data_driven_schema_configs: Managed schema with field-guessing support enabled"
+    echo "      _default: Minimal configuration, which supports enabling/disabling field-guessing support"
     echo "      sample_techproducts_configs: Example configuration with many optional features enabled to"
     echo "         demonstrate the full power of Solr"
     echo ""
-    echo "      If not specified, default is: data_driven_schema_configs"
+    echo "      If not specified, default is: _default"
     echo ""
     echo "      Alternatively, you can pass the path to your own configuration directory instead of using"
     echo "      one of the built-in configurations, such as: bin/solr create_core -c mycore -d /tmp/myconfig"
@@ -441,12 +440,11 @@ function print_usage() {
     echo ""
     echo "  -d <confdir>            Configuration directory to copy when creating the new collection, built-in options are:"
     echo ""
-    echo "      basic_configs: Minimal Solr configuration"
-    echo "      data_driven_schema_configs: Managed schema with field-guessing support enabled"
+    echo "      _default: Minimal configuration, which supports enabling/disabling field-guessing support"
     echo "      sample_techproducts_configs: Example configuration with many optional features enabled to"
     echo "         demonstrate the full power of Solr"
     echo ""
-    echo "      If not specified, default is: data_driven_schema_configs"
+    echo "      If not specified, default is: _default"
     echo ""
     echo "      Alternatively, you can pass the path to your own configuration directory instead of using"
     echo "      one of the built-in configurations, such as: bin/solr create_collection -c mycoll -d /tmp/myconfig"
@@ -935,7 +933,7 @@ if [[ "$SCRIPT_CMD" == "create" || "$SCRIPT_CMD" == "create_core" || "$SCRIPT_CM
   fi
 
   if [ -z "$CREATE_CONFDIR" ]; then
-    CREATE_CONFDIR='data_driven_schema_configs'
+    CREATE_CONFDIR='_default'
   fi
 
   # validate the confdir arg

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 8772200..0c05baa 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -404,12 +404,11 @@ echo   -c name     Name of core to create
 echo.
 echo   -d confdir  Configuration directory to copy when creating the new core, built-in options are:
 echo.
-echo       basic_configs: Minimal Solr configuration
-echo       data_driven_schema_configs: Managed schema with field-guessing support enabled
+echo       _default: Minimal configuration, which supports enabling/disabling field-guessing support
 echo       sample_techproducts_configs: Example configuration with many optional features enabled to
 echo          demonstrate the full power of Solr
 echo.
-echo       If not specified, default is: data_driven_schema_configs
+echo       If not specified, default is: _default
 echo.
 echo       Alternatively, you can pass the path to your own configuration directory instead of using
 echo       one of the built-in configurations, such as: bin\solr create_core -c mycore -d c:/tmp/myconfig
@@ -428,12 +427,11 @@ echo   -c name               Name of collection to create
 echo.
 echo   -d confdir            Configuration directory to copy when creating the new collection, built-in options are:
 echo.
-echo       basic_configs: Minimal Solr configuration
-echo       data_driven_schema_configs: Managed schema with field-guessing support enabled
+echo       _default: Minimal configuration, which supports enabling/disabling field-guessing support
 echo       sample_techproducts_configs: Example configuration with many optional features enabled to
 echo          demonstrate the full power of Solr
 echo.
-echo       If not specified, default is: data_driven_schema_configs
+echo       If not specified, default is: _default
 echo.
 echo       Alternatively, you can pass the path to your own configuration directory instead of using
 echo       one of the built-in configurations, such as: bin\solr create_collection -c mycoll -d c:/tmp/myconfig
@@ -1404,7 +1402,7 @@ IF "!CREATE_NAME!"=="" (
   set "SCRIPT_ERROR=Name (-c) is a required parameter for %SCRIPT_CMD%"
   goto invalid_cmd_line
 )
-IF "!CREATE_CONFDIR!"=="" set CREATE_CONFDIR=data_driven_schema_configs
+IF "!CREATE_CONFDIR!"=="" set CREATE_CONFDIR=_default
 IF "!CREATE_NUM_SHARDS!"=="" set CREATE_NUM_SHARDS=1
 IF "!CREATE_REPFACT!"=="" set CREATE_REPFACT=1
 IF "!CREATE_CONFNAME!"=="" set CREATE_CONFNAME=!CREATE_NAME!
@@ -1861,4 +1859,4 @@ REM Safe echo which does not mess with () in strings
 set "eout=%1"
 set eout=%eout:"=%
 echo !eout!
-GOTO :eof
\ No newline at end of file
+GOTO :eof

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index c207dcf..668dd4f 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -993,7 +993,7 @@ public class SolrCLI {
     }
   } // end ApiTool class
 
-  private static final String DEFAULT_CONFIG_SET = "data_driven_schema_configs";
+  private static final String DEFAULT_CONFIG_SET = "_default";
 
   private static final long MS_IN_MIN = 60 * 1000L;
   private static final long MS_IN_HOUR = MS_IN_MIN * 60L;
@@ -2681,7 +2681,7 @@ public class SolrCLI {
       File exDir = setupExampleDir(serverDir, exampleDir, exampleName);
       String collectionName = "schemaless".equals(exampleName) ? "gettingstarted" : exampleName;
       String configSet =
-          "techproducts".equals(exampleName) ? "sample_techproducts_configs" : "data_driven_schema_configs";
+          "techproducts".equals(exampleName) ? "sample_techproducts_configs" : "_default";
 
       boolean isCloudMode = cli.hasOption('c');
       String zkHost = cli.getOptionValue('z');
@@ -3054,7 +3054,7 @@ public class SolrCLI {
       // yay! numNodes SolrCloud nodes running
       int numShards = 2;
       int replicationFactor = 2;
-      String cloudConfig = "data_driven_schema_configs";
+      String cloudConfig = "_default";
       String collectionName = "gettingstarted";
 
       File configsetsDir = new File(serverDir, "solr/configsets");
@@ -3089,7 +3089,7 @@ public class SolrCLI {
             "How many replicas per shard would you like to create? [2] ", "a replication factor", 2, 1, 4);
 
         echo("Please choose a configuration for the "+collectionName+" collection, available options are:");
-        String validConfigs = "basic_configs, data_driven_schema_configs, or sample_techproducts_configs ["+cloudConfig+"] ";
+        String validConfigs = "_default or sample_techproducts_configs ["+cloudConfig+"] ";
         cloudConfig = prompt(readInput, validConfigs, cloudConfig);
 
         // validate the cloudConfig name

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index 5e98f05..2b79408 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -55,7 +55,8 @@ import static org.apache.solr.common.util.Utils.getObjectByPath;
 /**
  * Emulates bin/solr -e cloud -noprompt; bin/post -c gettingstarted example/exampledocs/*.xml;
  * this test is useful for catching regressions in indexing the example docs in collections that
- * use data-driven schema and managed schema features provided by configsets/data_driven_schema_configs.
+ * use data driven functionality and managed schema features of the default configset
+ * (configsets/_default).
  */
 public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
 
@@ -73,8 +74,8 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
     log.info("testLoadDocsIntoGettingStartedCollection initialized OK ... running test logic");
 
     String testCollectionName = "gettingstarted";
-    File data_driven_schema_configs = new File(ExternalPaths.SCHEMALESS_CONFIGSET);
-    assertTrue(data_driven_schema_configs.getAbsolutePath()+" not found!", data_driven_schema_configs.isDirectory());
+    File defaultConfigs = new File(ExternalPaths.DEFAULT_CONFIGSET);
+    assertTrue(defaultConfigs.getAbsolutePath()+" not found!", defaultConfigs.isDirectory());
 
     Set<String> liveNodes = cloudClient.getZkStateReader().getClusterState().getLiveNodes();
     if (liveNodes.isEmpty())
@@ -88,8 +89,8 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
         "-shards", "2",
         "-replicationFactor", "2",
         "-confname", testCollectionName,
-        "-confdir", "data_driven_schema_configs",
-        "-configsetsDir", data_driven_schema_configs.getParentFile().getParentFile().getAbsolutePath(),
+        "-confdir", "_default",
+        "-configsetsDir", defaultConfigs.getParentFile().getParentFile().getAbsolutePath(),
         "-solrUrl", solrUrl
     };
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 86554b5..0c2421f 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -418,7 +418,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
 
     // sthis test only support launching one SolrCloud node due to how MiniSolrCloudCluster works
     // and the need for setting the host and port system properties ...
-    String userInput = "1\n"+bindPort+"\n"+collectionName+"\n2\n2\ndata_driven_schema_configs\n";
+    String userInput = "1\n"+bindPort+"\n"+collectionName+"\n2\n2\n_default\n";
 
     // simulate user input from stdin
     InputStream userInputSim = new ByteArrayInputStream(userInput.getBytes(StandardCharsets.UTF_8));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/server/README.txt
----------------------------------------------------------------------
diff --git a/solr/server/README.txt b/solr/server/README.txt
index 744f479..228f4d4 100644
--- a/solr/server/README.txt
+++ b/solr/server/README.txt
@@ -62,12 +62,11 @@ server/solr/configsets
 
   Directories containing different configuration options for running Solr.
 
-    basic_configs               : Bare minimum configuration settings needed to run Solr.
-
-    data_driven_schema_configs  : Field-guessing and managed schema mode; use this configuration if you want
-                                  to start indexing data in Solr without having to design a schema upfront.
-                                  You can use the REST API to manage your schema as you refine your index
-                                  requirements.
+    _default                    : Bare minimum configurations with field-guessing and managed schema turned
+                                  on by default, so as to start indexing data in Solr without having to design
+                                  a schema upfront. You can use the REST API to manage your schema as you refine your index
+                                  requirements. You can turn off the field (for a collection, say mycollection) guessing by:
+                                  curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'
 
     sample_techproducts_configs : Comprehensive example configuration that demonstrates many of the powerful
                                   features of Solr, based on the use case of building a search solution for

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
index 0b3608b..312cb90 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkConfigManager.java
@@ -186,7 +186,7 @@ public class ZkConfigManager {
   
   // Order is important here since "confDir" may be
   // 1> a full path to the parent of a solrconfig.xml or parent of /conf/solrconfig.xml
-  // 2> one of the canned config sets only, e.g. basic_configs
+  // 2> one of the canned config sets only, e.g. _default
   // and trying to assemble a path for configsetDir/confDir is A Bad Idea. if confDir is a full path.
   
   public static Path getConfigsetPath(String confDir, String configSetDir) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
index 3d553d8..a7b4619 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
@@ -51,7 +51,7 @@ public class SolrSchemalessExampleTest extends SolrExampleTestsBase {
     FileUtils.copyFileToDirectory(new File(ExternalPaths.SERVER_HOME, "solr.xml"), tempSolrHome);
     File collection1Dir = new File(tempSolrHome, "collection1");
     FileUtils.forceMkdir(collection1Dir);
-    FileUtils.copyDirectoryToDirectory(new File(ExternalPaths.SCHEMALESS_CONFIGSET), collection1Dir);
+    FileUtils.copyDirectoryToDirectory(new File(ExternalPaths.DEFAULT_CONFIGSET), collection1Dir);
     Properties props = new Properties();
     props.setProperty("name","collection1");
     OutputStreamWriter writer = null;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e6037646/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
index 1ebb2e9..93bf92e 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
@@ -41,8 +41,8 @@ public class ExternalPaths {
   /* @see #SOURCE_HOME */
   public static String WEBAPP_HOME = new File(SOURCE_HOME, "webapp/web").getAbsolutePath();
   /* @see #SOURCE_HOME */
-  public static String SCHEMALESS_CONFIGSET =
-      new File(SOURCE_HOME, "server/solr/configsets/data_driven_schema_configs/conf").getAbsolutePath();
+  public static String DEFAULT_CONFIGSET =
+      new File(SOURCE_HOME, "server/solr/configsets/_default/conf").getAbsolutePath();
   public static String TECHPRODUCTS_CONFIGSET =
       new File(SOURCE_HOME, "server/solr/configsets/sample_techproducts_configs/conf").getAbsolutePath();