Apache Lucene open-source search software
SOLR-12769: correct documentation for delete op in request params API
Munendra S N227a624f8afe
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 3c813713d13..71497c7a085 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -112,11 +112,13 @@ OptimizationsBug Fixes---------------------+* SOLR-13827: Fail on unknown operation in Request Parameters API (Munendra S N, noble)Other Changes----------------------(No changes)++* SOLR-12769: Fix incorrect documentation for 'delete' op in Request parameters API (Alexandre Rafalovitch, Munendra S N)================== 8.3.0 ==================diff --git a/solr/solr-ref-guide/src/request-parameters-api.adoc b/solr/solr-ref-guide/src/request-parameters-api.adocindex f76b2d82ea1..047c14749a1 100644--- a/solr/solr-ref-guide/src/request-parameters-api.adoc+++ b/solr/solr-ref-guide/src/request-parameters-api.adoc@@ -35,19 +35,19 @@ When might you want to use this feature?All requests are sent to the `/config/params` endpoint of the Config API.-== Setting Request Parameters+== Configuring Request Parameters-The request to set, unset, or update request parameters is sent as a set of Maps with names. These objects can be directly used in a request or a request handler definition.+The request to set, or update request parameters is sent as a set of Maps with names. These objects can be directly used in a request or a request handler definition. The request to delete parameter set is sent as list of names or a name.The available commands are:* `set`: Create or overwrite a parameter set map.-* `unset`: delete a parameter set map.+* `delete`: Remove a request parameter set map.* `update`: update a parameter set map. This is equivalent to a `map.putAll(newMap)`. Both the maps are merged and if the new map has same keys as old they are overwritten.You can mix these commands into a single request if necessary.-Each map must include a name so it can be referenced later, either in a direct request to Solr or in a request handler definition.+For `set` or `update` commands, each map must include a name so it can be referenced later, either in a direct request to Solr or in a request handler definition.In the following example, we are setting 2 sets of parameters named 'myFacets' and 'myQueries'.@@ -83,6 +83,27 @@ curl http://localhost:8983/solr/techproducts/config/params -H 'Content-type:appl}'----+In the following example, two set of parameters named 'myFacets' and 'myQueries' are deleted.++[source,bash]+----+curl http://localhost:8983/solr/techproducts/config/params -H 'Content-type:application/json' -d '{+ "delete":[+ "myFacets",+ "myQueries"+ ]+}'+----++When deleting a single parameter set, the value could be specified as string instead of list.++[source,bash]+----+curl http://localhost:8983/solr/techproducts/config/params -H 'Content-type:application/json' -d '{+ "delete":"myFacets"+}'+----+== Using Request Parameters with RequestHandlersAfter creating the `my_handler_params` paramset in the above section, it is possible to define a request handler as follows:diff --git a/solr/solrj/src/resources/apispec/core.config.Params.Commands.json b/solr/solrj/src/resources/apispec/core.config.Params.Commands.jsonindex 675d9ee17cc..2691c1c50fb 100644--- a/solr/solrj/src/resources/apispec/core.config.Params.Commands.json+++ b/solr/solrj/src/resources/apispec/core.config.Params.Commands.json@@ -15,7 +15,7 @@"description":"Add or overwrite one or more paramsets. Each paramset definition includes a paramset name, followed by key-value pairs of the parameter and value to be set.","additionalProperties": true},- "unset": {+ "delete": {"type":"array","description": "Delete one or more paramsets.","items": {