diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 170aae3e4ef..3abcdea4829 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -482,6 +482,8 @@ Other Changes * SOLR-12183: Refactor Streaming Expression test cases (Joel Bernstein) +* SOLR-12437: Document 'bin/solr config' in the ref guide. (Steve Rowe) + ================== 7.3.1 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. diff --git a/solr/solr-ref-guide/src/schemaless-mode.adoc b/solr/solr-ref-guide/src/schemaless-mode.adoc index 384e866e0b5..b62a92ee0c3 100644 --- a/solr/solr-ref-guide/src/schemaless-mode.adoc +++ b/solr/solr-ref-guide/src/schemaless-mode.adoc @@ -205,10 +205,10 @@ IMPORTANT: After all of these changes have been made, Solr should be restarted o === Disabling Automatic Field Guessing -Automatic field creation can be disabled with the `update.autoCreateFields` property. To do this, you can use the <> with a command such as: +Automatic field creation can be disabled with the `update.autoCreateFields` property. To do this, you can use <> with a command such as: [source,bash] -curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' +bin/solr config -c mycollection -p 8983 -action set-user-property -property update.autoCreateFields -value false == Examples of Indexed Documents diff --git a/solr/solr-ref-guide/src/solr-control-script-reference.adoc b/solr/solr-ref-guide/src/solr-control-script-reference.adoc index 4f3eb45110a..8121241720a 100644 --- a/solr/solr-ref-guide/src/solr-control-script-reference.adoc +++ b/solr/solr-ref-guide/src/solr-control-script-reference.adoc @@ -461,10 +461,10 @@ Other collections can share the same configuration by specifying the name of the ==== Data-driven Schema and Shared Configurations -The `_default` schema can mutate as data is indexed, since it has schemaless functionality (i.e., data-driven changes to the schema). Consequently, we recommend that you do not share data-driven configurations between collections unless you are certain that all collections should inherit the changes made when indexing data into one of the collections. You can turn off schemaless functionality (i.e., data-driven changes to the schema) for a collection by the following (assuming the collection name is `mycollection`): +The `_default` schema can mutate as data is indexed, since it has schemaless functionality (i.e., data-driven changes to the schema). Consequently, we recommend that you do not share data-driven configurations between collections unless you are certain that all collections should inherit the changes made when indexing data into one of the collections. You can turn off schemaless functionality (i.e., data-driven changes to the schema) for a collection by the following, assuming the collection name is `mycollection` - see <>: [source,text] -curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' +bin/solr config -c mycollection -p 8983 -action set-user-property -property update.autoCreateFields -value false === Delete Core or Collection @@ -579,6 +579,61 @@ If the `-updateIncludeFileOnly` option is set to *true*, then only the settings If the `-updateIncludeFileOnly` option is set to *false*, then the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will be removed. However, the `basicAuth.conf` file is not removed with either option. +== Set or Unset Configuration Properties + +The `bin/solr` script enables a subset of the Config API: <> and <>. + +`bin/solr config [options]` + +`bin/solr config -help` + +=== Set or Unset Common Properties + +To set the common property `updateHandler.autoCommit.maxDocs` to `100` on collection `mycollection`: + +`bin/solr config -c mycollection -p 8983 -action set-property -property updateHandler.autoCommit.maxDocs -value 100` + +The default `-action` is `set-property`, so the above can be shortened by not mentioning it: + +`bin/solr config -c mycollection -p 8983 -property updateHandler.autoCommit.maxDocs -value 100` + +To unset a previously set common property, specify `-action unset-property` with no `-value`: + +`bin/solr config -c mycollection -p 8983 -action unset-property -property updateHandler.autoCommit.maxDocs` + +=== Set or Unset User-defined Properties + +To set the user-defined property `update.autoCreateFields` to `false` (to disable <>): + +`bin/solr config -c mycollection -p 8983 -action set-user-property -property update.autoCreateFields -value false` + +To unset a previously set user-defined property, specify `-action unset-user-property` with no `-value`: + +`bin/solr config -c mycollection -p 8983 -action unset-user-property -property update.autoCreateFields` + +=== Config Parameters + +`-c `:: +Name of the core or collection on which to change configuration (required). + +`-action `:: +Config API action, one of: `set-property`, `unset-property`, `set-user-property`, `unset-user-property`; defaults to `set-property`. + +`-property `:: +Name of the property to change (required). + +`-value `:: +Set the property to this value. + +`-z `:: +The ZooKeeper connection string, usable in SolrCloud mode. Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`. + +`-p `:: +`localhost` port of the Solr node to use when applying the configuration change. + +`-solrUrl `:: +Base Solr URL, which can be used in SolrCloud mode to determine the ZooKeeper connection string if that's not known. + == ZooKeeper Operations The `bin/solr` script allows certain operations affecting ZooKeeper. These operations are for SolrCloud mode only. The operations are available as sub-commands, which each have their own set of options. diff --git a/solr/solr-ref-guide/src/solr-tutorial.adoc b/solr/solr-ref-guide/src/solr-tutorial.adoc index 89c62194188..9d07efaebfd 100644 --- a/solr/solr-ref-guide/src/solr-tutorial.adoc +++ b/solr/solr-ref-guide/src/solr-tutorial.adoc @@ -529,7 +529,7 @@ WARNING: Using _default configset. Data driven schema functionality is enabled b NOT RECOMMENDED for production use. To turn it off: - curl http://localhost:7574/solr/films/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' + bin/solr config -c films -p 7574 -action set-user-property -property update.autoCreateFields -value false Connecting to ZooKeeper at localhost:9983 ... INFO - 2017-07-27 15:07:46.191; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready