SOLR-12437: Document 'bin/solr config' in the ref guide

This commit is contained in:
Steve Rowe 2018-06-14 16:29:46 -04:00
parent a98fcda9c6
commit 26a1143dcf
4 changed files with 62 additions and 5 deletions

View File

@ -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.

View File

@ -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 <<config-api.adoc#config-api,Config API>> with a command such as:
Automatic field creation can be disabled with the `update.autoCreateFields` property. To do this, you can use <<solr-control-script-reference.adoc#set-or-unset-configuration-properties,`bin/solr config`>> 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

View File

@ -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 <<Set or Unset Configuration Properties>>:
[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: <<config-api.adoc#commands-for-common-properties,(un)setting common properties>> and <<config-api.adoc#commands-for-user-defined-properties,(un)setting user-defined properties>>.
`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 <<schemaless-mode.adoc#schemaless-mode,Schemaless Mode>>):
`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>`::
Name of the core or collection on which to change configuration (required).
`-action <name>`::
Config API action, one of: `set-property`, `unset-property`, `set-user-property`, `unset-user-property`; defaults to `set-property`.
`-property <name>`::
Name of the property to change (required).
`-value <new-value>`::
Set the property to this value.
`-z <zkHost>`::
The ZooKeeper connection string, usable in SolrCloud mode. Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
`-p <port>`::
`localhost` port of the Solr node to use when applying the configuration change.
`-solrUrl <url>`::
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.

View File

@ -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