This is an automated email from the ASF dual-hosted git repository. dsmiley pushed a commit to branch branch_10x in repository https://gitbox.apache.org/repos/asf/solr.git
commit c38953f4d7c3bd409acbe44007b339218f13643e Author: Serhiy Bzhezytskyy <[email protected]> AuthorDate: Thu Oct 1 19:50:09 2026 +0300 SOLR-18460: Ensure all curl commands follow the same pattern (#4925) (cherry picked from commit c3e18f1e45506af2ed1a0087af6bcaec5b60fdf6) --- .../configuration-guide/pages/cluster-plugins.adoc | 21 +++---- .../pages/cluster-singleton-plugins.adoc | 3 +- .../configuration-guide/pages/collections-api.adoc | 2 +- .../configuration-guide/pages/config-api.adoc | 66 ++++++++++---------- .../configuration-guide/pages/config-sets.adoc | 3 +- .../configuration-guide/pages/configsets-api.adoc | 12 ++-- .../configuration-guide/pages/coreadmin-api.adoc | 12 ++-- .../pages/property-substitution.adoc | 2 +- .../pages/replica-placement-plugins.adoc | 15 ++--- .../pages/request-parameters-api.adoc | 6 +- .../modules/configuration-guide/pages/v2-api.adoc | 6 +- .../deployment-guide/pages/alias-management.adoc | 6 +- .../pages/cluster-node-management.adoc | 10 +-- .../pages/collection-management.adoc | 18 +++--- .../deployment-guide/pages/enabling-ssl.adoc | 6 +- .../deployment-guide/pages/rate-limiters.adoc | 4 +- .../deployment-guide/pages/replica-management.adoc | 4 +- .../deployment-guide/pages/shard-management.adoc | 6 +- .../pages/solr-control-script-reference.adoc | 8 +-- .../getting-started/pages/tutorial-diy.adoc | 4 +- .../getting-started/pages/tutorial-films.adoc | 12 ++-- .../pages/tutorial-five-minutes.adoc | 12 ++-- .../getting-started/pages/tutorial-opennlp.adoc | 34 +++++----- .../getting-started/pages/tutorial-paramsets.adoc | 8 +-- .../getting-started/pages/tutorial-solrcloud.adoc | 4 +- .../pages/tutorial-techproducts.adoc | 12 ++-- .../getting-started/pages/tutorial-vectors.adoc | 2 +- .../pages/indexing-nested-documents.adoc | 4 +- .../indexing-guide/pages/indexing-with-tika.adoc | 4 +- .../pages/indexing-with-update-handlers.adoc | 10 +-- .../pages/partial-document-updates.adoc | 22 +++---- .../modules/indexing-guide/pages/reindexing.adoc | 2 +- .../modules/indexing-guide/pages/schema-api.adoc | 72 +++++++++++----------- .../query-guide/pages/dense-vector-search.adoc | 2 +- .../query-guide/pages/json-combined-query-dsl.adoc | 2 +- .../modules/query-guide/pages/json-facet-api.adoc | 4 +- .../modules/query-guide/pages/json-query-dsl.adoc | 22 +++---- .../modules/query-guide/pages/morelikethis.adoc | 4 +- .../query-guide/pages/pagination-of-results.adoc | 10 +-- .../query-guide/pages/response-writers.adoc | 2 +- .../pages/searching-nested-documents.adoc | 16 ++--- .../modules/query-guide/pages/spatial-search.adoc | 2 + .../modules/query-guide/pages/tagger-handler.adoc | 10 +-- .../pages/major-changes-in-solr-8.adoc | 6 +- .../pages/major-changes-in-solr-9.adoc | 4 +- 45 files changed, 243 insertions(+), 253 deletions(-) diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-plugins.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-plugins.adoc index bdc6cd160ef..939b3a93017 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-plugins.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-plugins.adoc @@ -92,7 +92,7 @@ Example plugin configuration: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory", @@ -105,7 +105,6 @@ curl -X POST -H 'Content-type: application/json' -d '{ } } }}' - http://localhost:8983/api/cluster/plugin ---- === Types of Cluster Plugins @@ -173,22 +172,20 @@ Event producer configuration can be changed dynamically by changing the predefin [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".cluster-event-producer", "class": "org.apache.solr.cluster.events.impl.DefaultClusterEventProducer" }}' - http://localhost:8983/api/cluster/plugin ---- It can be restored to the default no-op configuration by simply removing the plugin: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "remove": ".cluster-event-producer" }' - http://localhost:8983/api/cluster/plugin ---- === ClusterEventListener Plugins @@ -210,12 +207,11 @@ Example plugin configuration: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": "collections-repair-listener", "class": "org.apache.solr.cluster.events.impl.CollectionsRepairEventListener" }}' - http://localhost:8983/api/cluster/plugin ---- == Plugin Management API @@ -237,13 +233,12 @@ If a plugin with the same name already exists this results in an error. Example command, which adds a plugin contained in a Solr package: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": "my-plugin1", "class": "my-package:com.example.MyPlugin", "version": "1.0" }}' - http://localhost:8983/api/cluster/plugin ---- === Update Plugin @@ -256,14 +251,13 @@ The old instance of the plugin is removed and a new instance is created using th [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "update":{ "name": "collections-repair-listener", "class": "org.apache.solr.cluster.events.impl.CollectionsRepairEventListener", "config":{ "waitForSecond": 30 }}}' - http://localhost:8983/api/cluster/plugin ---- === Remove Plugin @@ -275,8 +269,7 @@ Unlike other commands the command payload here consists just of the name of the [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "remove": "my-plugin1" }' - http://localhost:8983/api/cluster/plugin ---- diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-singleton-plugins.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-singleton-plugins.adoc index 5afdcb0d18a..4410be68f24 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-singleton-plugins.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/cluster-singleton-plugins.adoc @@ -36,7 +36,7 @@ Shards become INACTIVE when they are split, and the documents they contain are n Configuration using the cluster plugin API [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".inactive-shard-remover", "class": "org.apache.solr.cluster.maintenance.InactiveShardRemover", @@ -46,7 +46,6 @@ curl -X POST -H 'Content-type: application/json' -d '{ "maxDeletesPerCycle": 20 } }}' - http://localhost:8983/api/cluster/plugin ---- Configuration in solr.xml diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/collections-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/collections-api.adoc index 71a20e63acf..b6991820be8 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/collections-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/collections-api.adoc @@ -65,7 +65,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/collection1/shards -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/collection1/shards -H 'Content-Type: application/json' -d ' { "split": { "shard": "shard1", diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc index 878e8dd0d6a..f01f882a0d0 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc @@ -266,7 +266,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' http://localhost:8983/solr/techproducts/config +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' ---- ==== V2 API:: @@ -274,7 +274,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' ---- ==== ====== @@ -325,7 +325,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{"unset-property": "updateHandler.autoCommit.maxTime"}' http://localhost:8983/solr/techproducts/config +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type: application/json' -d '{"unset-property": "updateHandler.autoCommit.maxTime"}' ---- ==== @@ -334,7 +334,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{"unset-property": "updateHandler.autoCommit.maxTime"}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type: application/json' -d '{"unset-property": "updateHandler.autoCommit.maxTime"}' ---- ==== ====== @@ -405,14 +405,14 @@ To create a request handler, we can use the `add-requesthandler` command: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/mypath", "class": "solr.DumpRequestHandler", "defaults":{ "x": "y" ,"a": "b", "rows":10 }, "useParams": "x" } -}' http://localhost:8983/solr/techproducts/config +}' ---- [tabs#addhandler] @@ -422,14 +422,14 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/mypath", "class": "solr.DumpRequestHandler", "defaults": { "x": "y" ,"a": "b", "rows":10 }, "useParams": "x" } -}' http://localhost:8983/solr/techproducts/config +}' ---- ==== @@ -438,14 +438,14 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/mypath", "class": "solr.DumpRequestHandler", "defaults": { "x": "y" ,"a": "b", "rows":10 }, "useParams": "x" } -}' http://localhost:8983/api/collections/techproducts/config +}' ---- ==== ====== @@ -454,7 +454,7 @@ Make a call to the new request handler to check if it is registered: [source,bash] ---- -$ curl http://localhost:8983/solr/techproducts/mypath?omitHeader=true +curl http://localhost:8983/solr/techproducts/mypath?omitHeader=true ---- And you should see the following as output: @@ -481,14 +481,14 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{ "update-requesthandler": { "name": "/mypath", "class": "solr.DumpRequestHandler", "defaults": {"x": "new value for X", "rows": "20"}, "useParams": "x" } -}' http://localhost:8983/solr/techproducts/config +}' ---- ==== @@ -497,14 +497,14 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{ "update-requesthandler": { "name": "/mypath", "class": "solr.DumpRequestHandler", "defaults": {"x": "new value for X", "rows": "20"}, "useParams": "x" } -}' http://localhost:8983/api/collections/techproducts/config +}' ---- ==== ====== @@ -518,14 +518,14 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/myterms", "class": "solr.SearchHandler", "defaults": {"terms": true, "distrib":false}, "components": ["terms"] } -}' http://localhost:8983/solr/techproducts/config +}' ---- ==== @@ -534,14 +534,14 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/myterms", "class": "solr.SearchHandler", "defaults": {"terms": true, "distrib":false}, "components": ["terms"] } -}' http://localhost:8983/api/collections/techproducts/config +}' ---- ==== ====== @@ -555,9 +555,9 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{ "delete-requesthandler": "/myterms" -}' http://localhost:8983/solr/techproducts/config +}' ---- ==== @@ -566,9 +566,9 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{ "delete-requesthandler": "/myterms" -}' http://localhost:8983/api/collections/techproducts/config +}' ---- ==== ====== @@ -601,7 +601,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"set-user-property": {"variable_name": "some_value"}}' http://localhost:8983/solr/techproducts/config +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{"set-user-property": {"variable_name": "some_value"}}' ---- ==== @@ -610,7 +610,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"set-user-property": {"variable_name": "some_value"}}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{"set-user-property": {"variable_name": "some_value"}}' ---- ==== ====== @@ -658,7 +658,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"unset-user-property": "variable_name"}' http://localhost:8983/solr/techproducts/config +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{"unset-user-property": "variable_name"}' ---- ==== @@ -667,7 +667,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"unset-user-property": "variable_name"}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{"unset-user-property": "variable_name"}' ---- ==== ====== @@ -686,11 +686,11 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"add-updateprocessor": +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{"add-updateprocessor": {"name": "firstFld", "class": "solr.FirstFieldValueUpdateProcessorFactory", "fieldName": "test_s"} -}' http://localhost:8983/solr/techproducts/config +}' ---- ==== @@ -699,11 +699,11 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{"add-updateprocessor": +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{"add-updateprocessor": {"name": "firstFld", "class": "solr.FirstFieldValueUpdateProcessorFactory", "fieldName": "test_s"} -}' http://localhost:8983/api/collections/techproducts/config +}' ---- ==== ====== @@ -894,7 +894,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{}' http://localhost:8983/solr/techproducts/config +curl 'http://localhost:8983/solr/techproducts/config' -H 'Content-type:application/json' -d '{}' ---- ==== @@ -903,7 +903,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type:application/json' -d '{}' ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc index 2b7433a6abb..276e5105e74 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-sets.adoc @@ -108,12 +108,11 @@ V2 API:: ==== [source,bash] ---- -curl -v -X POST -H 'Content-type: application/json' -d '{ +curl -v 'http://localhost:8983/api/cores' -H 'Content-type: application/json' -d '{ "create":[{ "name": "mycore", "instanceDir": "path/to/instance", "configSet": "configSet2"}]}' - http://localhost:8983/api/cores ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc index 81d5ff78646..f5afc5e984a 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/configsets-api.adoc @@ -180,14 +180,14 @@ With the v1 API, the `upload` command must be capitalized as `UPLOAD`: ---- $ (cd solr/server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) > myconfigset.zip -$ curl -X POST --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" +curl "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip ---- The same can be achieved using a Unix pipe with a single request as follows: [source,bash] ---- -$ (cd server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) | curl -X POST --header "Content-Type:application/octet-stream" --data-binary @- "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" +$ (cd server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) | curl "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet" --header "Content-Type:application/octet-stream" --data-binary @- ---- ==== @@ -200,7 +200,7 @@ With the v2 API, the name of the configset to upload is provided as a path param ---- $ (cd solr/server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) > myconfigset.zip -$ curl -X PUT --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip +curl -X PUT --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/api/configsets/myConfigSet" ---- @@ -248,9 +248,8 @@ The filename to upload is provided via the `filePath` parameter: [source,bash] ---- -curl -X POST --header "Content-Type:application/octet-stream" +curl "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet&filePath=solrconfig.xml" --header "Content-Type:application/octet-stream" --data-binary @solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml - "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet&filePath=solrconfig.xml" ---- ==== @@ -416,14 +415,13 @@ With the v2 API, the `create` command is implicit and parameters are specified i [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/configsets?omitHeader=true' -H 'Content-type: application/json' -d '{ "name": "myConfigSet", "baseConfigSet": "predefinedTemplate", "properties": { "immutable": "false" } }' - http://localhost:8983/api/configsets?omitHeader=true ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc index a7dff995ee3..5ce880ba795 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc @@ -136,7 +136,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores -H 'Content-Type: application/json' -d ' { "name": "techproducts_v2", "configSet": "sample_techproducts_configs" @@ -360,7 +360,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores/currentCoreName/rename -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores/currentCoreName/rename -H 'Content-Type: application/json' -d ' { "to": "newCoreName" } @@ -424,7 +424,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores/_core-name_/swap -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores/_core-name_/swap -H 'Content-Type: application/json' -d ' { "with": "_other-core-name_" } @@ -492,7 +492,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores/techproducts/unload -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores/techproducts/unload -H 'Content-Type: application/json' -d ' {} ' ---- @@ -579,7 +579,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores/targetCoreName/merge-indices -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores/targetCoreName/merge-indices -H 'Content-Type: application/json' -d ' { "indexDirs": ["path/to/core1/data/index","path/to/core2/data/index"] } @@ -610,7 +610,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cores/targetCoreName/merge-indices -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cores/targetCoreName/merge-indices -H 'Content-Type: application/json' -d ' { "srcCores": ["core1","core2"] } diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/property-substitution.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/property-substitution.adoc index 451decca0f8..29fd46ba131 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/property-substitution.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/property-substitution.adoc @@ -95,7 +95,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{"name": "gettingstarted", "numShards": 1, "properties": {"my.custom.prop": "edismax"}}' http://localhost:8983/api/collections +curl 'http://localhost:8983/api/collections' -H 'Content-type: application/json' -d '{"name": "gettingstarted", "numShards": 1, "properties": {"my.custom.prop": "edismax"}}' ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/replica-placement-plugins.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/replica-placement-plugins.adoc index 6cf06903014..396c17aae2e 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/replica-placement-plugins.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/replica-placement-plugins.adoc @@ -46,7 +46,7 @@ For example, in order to use the `AffinityPlacementFactory` plugin the following [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory", @@ -63,7 +63,6 @@ curl -X POST -H 'Content-type: application/json' -d '{ } } }}' - http://localhost:8983/api/cluster/plugin ---- Similarly, the configuration can be updated or removed. @@ -219,18 +218,17 @@ This is a simple configuration that uses default values: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory" }}' - http://localhost:8983/api/cluster/plugin ---- This configuration specifies the base parameters: [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory", @@ -239,7 +237,6 @@ curl -X POST -H 'Content-type: application/json' -d '{ "prioritizedFreeDiskGB": 100 } }}' - http://localhost:8983/api/cluster/plugin ---- This configuration defines that collection `A_primary` must be co-located with @@ -247,7 +244,7 @@ collection `Common_secondary`, and collection `B_primary` must be co-located als [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory", @@ -258,7 +255,6 @@ curl -X POST -H 'Content-type: application/json' -d '{ } } }}' - http://localhost:8983/api/cluster/plugin ---- This configuration defines that collection `collection_A` must be placed only on the nodes with the `node_type` system property containing either `searchNode` or `indexNode` (for example, a node may be labeled as `-Dnode_type=searchNode,indexNode,uiNode,zkNode`). @@ -266,7 +262,7 @@ Similarly, the collection `collection_B` must be placed only on the nodes that c [source,bash] ---- -curl -X POST -H 'Content-type: application/json' -d '{ +curl 'http://localhost:8983/api/cluster/plugin' -H 'Content-type: application/json' -d '{ "add":{ "name": ".placement-plugin", "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory", @@ -277,5 +273,4 @@ curl -X POST -H 'Content-type: application/json' -d '{ } } }}' - http://localhost:8983/api/cluster/plugin ---- diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/request-parameters-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/request-parameters-api.adoc index 8e7870fa43c..9ca00782adf 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/request-parameters-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/request-parameters-api.adoc @@ -154,7 +154,7 @@ As an example, for the `/export` request handler: [source,bash] ---- -$ curl http://localhost:8983/solr/techproducts/config/requestHandler?componentName=/export&expandParams=true +curl http://localhost:8983/solr/techproducts/config/requestHandler?componentName=/export&expandParams=true ---- == Viewing Request Parameters @@ -163,10 +163,10 @@ To see the paramsets that have been created, you can use the `/config/params` en [source,bash] ---- -$ curl http://localhost:8983/solr/techproducts/config/params +curl http://localhost:8983/solr/techproducts/config/params #Or use the paramset name -$ curl http://localhost:8983/solr/techproducts/config/params/myQueries +curl http://localhost:8983/solr/techproducts/config/params/myQueries ---- == The useParams Parameter diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/v2-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/v2-api.adoc index fb849d4f378..7fcd600c7fb 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/v2-api.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/v2-api.adoc @@ -143,7 +143,7 @@ For the "gettingstarted" collection, set the replication factor and whether to a [source,bash] ---- -$ curl http://localhost:8983/api/c/gettingstarted -H 'Content-type:application/json' -d ' +curl http://localhost:8983/api/c/gettingstarted -H 'Content-type:application/json' -d ' { modify: { replicationFactor: "3" } }' {"responseHeader":{"status":0,"QTime":842}} @@ -153,7 +153,7 @@ See the state of the cluster: [source,bash] ---- -$ curl http://localhost:8983/api/cluster +curl http://localhost:8983/api/cluster {"responseHeader":{"status":0,"QTime":0},"collections":["gettingstarted"]} ---- @@ -162,7 +162,7 @@ Set a cluster property: [source,bash] ---- -$ curl http://localhost:8983/api/cluster -H 'Content-type: application/json' -d ' +curl http://localhost:8983/api/cluster -H 'Content-type: application/json' -d ' { set-property: { name: maxCoresPerNode, val: "100" } }' {"responseHeader":{"status":0,"QTime":4}} diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/alias-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/alias-management.adoc index 1c58ab0c380..e304ff2e0c9 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/alias-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/alias-management.adoc @@ -343,7 +343,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' { "name":"testalias", "collections":["foo","bar"] @@ -414,7 +414,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' { "name": "somethingTemporalThisWayComes", "routers" : [ @@ -504,7 +504,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/aliases -H 'Content-Type: application/json' -d ' { "name":"dra_test1", "routers": [ diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/cluster-node-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/cluster-node-management.adoc index d1c84824235..43ffe3afaff 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/cluster-node-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/cluster-node-management.adoc @@ -536,7 +536,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cluster/replicas/balance -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cluster/replicas/balance -H 'Content-Type: application/json' -d ' { "nodes": ["localhost:8983_solr", "localhost:8984_solr"], "async": "balance-replicas-1" @@ -615,7 +615,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/balance-shard-unique -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/balance-shard-unique -H 'Content-Type: application/json' -d ' { "property": "preferredLeader" } @@ -714,7 +714,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/cluster/replicas/migrate -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/cluster/replicas/migrate -H 'Content-Type: application/json' -d ' { "sourceNodes": ["localhost:8983_solr", "localhost:8984_solr"], "targetNodes": ["localhost:8985_solr", "localhost:8986_solr"], @@ -815,7 +815,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST "http://localhost:8983/api/cluster/nodes/localhost:7574_solr/replace" -H 'Content-Type: application/json' -d ' +curl "http://localhost:8983/api/cluster/nodes/localhost:7574_solr/replace" -H 'Content-Type: application/json' -d ' { "targetNodeName": "localhost:8983_solr", "waitForFinalState": "false", @@ -921,7 +921,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST "http://localhost:8983/api/cluster/nodes/localhost:7574_solr/clear/" -H 'Content-Type: application/json' -d ' +curl "http://localhost:8983/api/cluster/nodes/localhost:7574_solr/clear/" -H 'Content-Type: application/json' -d ' { "async": "someAsyncId" } diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc index a2eade1e7d7..274c9ab1a6f 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc @@ -51,7 +51,7 @@ With the v2 API, the `create` command is provided as part of the JSON data that [source,bash] ---- -curl -X POST http://localhost:8983/api/collections -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections -H 'Content-Type: application/json' -d ' { "name": "techproducts_v2", "config": "techproducts", @@ -335,7 +335,7 @@ With the v2 API, the `reload` command is provided as a part of URL path. The req [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts_v2/reload -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts_v2/reload -H 'Content-Type: application/json' -d ' { "async": "someAsyncId" } @@ -401,7 +401,7 @@ With the v2 API, the `modify` command is provided as part of the JSON data that [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts_v2 -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts_v2 -H 'Content-Type: application/json' -d ' { "modify": { "replicationFactor": 2 @@ -541,7 +541,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/rename -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/rename -H 'Content-Type: application/json' -d ' { "to": "newName" } @@ -827,7 +827,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts_v2 -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts_v2 -H 'Content-Type: application/json' -d ' { "migrate-docs": { "target": "postMigrationCollection", @@ -1601,7 +1601,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/backups/techproducts_backup/versions -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/backups/techproducts_backup/versions -H 'Content-Type: application/json' -d ' { "location": "file:///path/to/my/shared/drive" } @@ -1922,7 +1922,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/backups/techproducts_backup/restore -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/backups/techproducts_backup/restore -H 'Content-Type: application/json' -d ' { "collection": "techproducts_v3", "location": "file:///path/to/my/shared/drive", @@ -2245,7 +2245,7 @@ With the v2 API, the `rebalance-leaders` command is provided as part of the JSON [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts -H 'Content-Type: application/json' -d ' { "rebalance-leaders": { "maxAtOnce": 3 @@ -2383,7 +2383,7 @@ V2 API:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/snapshots/snapshot0 -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/snapshots/snapshot0 -H 'Content-Type: application/json' -d ' { "followAliases": true, "async": "someAsyncId" diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc index 3a455450a48..92e5af2d8f5 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/enabling-ssl.adoc @@ -220,7 +220,7 @@ The curl commands in the following sections will not work with the system `curl` Instead, the certificate supplied with the `-E` parameter must be in PKCS12 format, and the file supplied with the `--cacert` parameter must contain only the CA certificate, and no key (see <<Convert the Certificate and Key to PEM Format for Use with curl,above>> for instructions on creating this file): [source,bash] -$ curl -E solr-ssl.keystore.p12:secret --cacert solr-ssl.cacert.pem ... +curl -E solr-ssl.keystore.p12:secret --cacert solr-ssl.cacert.pem ... ==== @@ -259,7 +259,7 @@ To get the resulting cluster status (again, if you have not enabled client authe [source,terminal] ---- -$ curl -E solr-ssl.pem:secret --cacert solr-ssl.pem "https://localhost:8984/solr/admin/collections?action=CLUSTERSTATUS&indent=on" +curl -E solr-ssl.pem:secret --cacert solr-ssl.pem "https://localhost:8984/solr/admin/collections?action=CLUSTERSTATUS&indent=on" ---- You should get a response that looks like this: @@ -313,7 +313,7 @@ If you have not enabled client authentication (system property `-Djetty.ssl.clie [source,console] ---- -$ curl -E solr-ssl.pem:secret --cacert solr-ssl.pem "https://localhost:8984/solr/mycollection/select?q=*:*" +curl -E solr-ssl.pem:secret --cacert solr-ssl.pem "https://localhost:8984/solr/mycollection/select?q=*:*" ---- === Index a Document using CloudSolrClient diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/rate-limiters.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/rate-limiters.adoc index 835802e4054..f96749740ac 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/rate-limiters.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/rate-limiters.adoc @@ -46,7 +46,7 @@ The current implementation has a query rate limiter which can free up resources The default rate limiter is search rate limiter. Accordingly, it can be configured using the following command: - curl -X POST -H 'Content-type:application/json' -d '{ + curl 'http://localhost:8983/api/cluster' -H 'Content-type:application/json' -d '{ "set-ratelimiter": { "enabled": true, "guaranteedSlots":5, @@ -54,7 +54,7 @@ Accordingly, it can be configured using the following command: "slotBorrowingEnabled":true, "slotAcquisitionTimeoutInMS":70 } - }' http://localhost:8983/api/cluster + }' === Enable Query Rate Limiter Controls enabling of query rate limiter. diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/replica-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/replica-management.adoc index 73c19a9db47..a602d6b3a5b 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/replica-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/replica-management.adoc @@ -72,7 +72,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/shards/shard1/replicas -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/shards/shard1/replicas -H 'Content-Type: application/json' -d ' { "node":"localhost:8983_solr" } @@ -336,7 +336,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts -H 'Content-Type: application/json' -d ' { "move-replica":{ "replica":"core_node6", diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/shard-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/shard-management.adoc index e623424b6aa..cd46cc464f4 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/shard-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/shard-management.adoc @@ -65,7 +65,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/shards -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/shards -H 'Content-Type: application/json' -d ' { "split":{ "shard":"shard1" @@ -319,7 +319,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/shards -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/shards -H 'Content-Type: application/json' -d ' { "shard":"newShardName" } @@ -675,7 +675,7 @@ V2 API:: [source,bash] ---- -curl -X POST http://localhost:8983/api/collections/techproducts/shards/shard1/install -H 'Content-Type: application/json' -d ' +curl http://localhost:8983/api/collections/techproducts/shards/shard1/install -H 'Content-Type: application/json' -d ' { "repository": "localfs", "location": "/mounts/myNFSDrive/tech/shard1/data/index" diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc index 116957b3ad7..da569f9ef95 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc @@ -1919,7 +1919,7 @@ Notice the different endpoints used depending on the format. *Example: import `json` files* -`curl -X POST --header "Content-Type: application/json" -d @gettingstarted.json http://localhost:8983/solr/gettingstarted/update/json?commit=true` +`curl http://localhost:8983/solr/gettingstarted/update/json?commit=true --header "Content-Type: application/json" -d @gettingstarted.json` *Example: import `json` files* @@ -1941,12 +1941,12 @@ Now import the data with either of these methods: [,console] ---- -$ curl -X POST --header "Content-Type: application/json" -d @gettingstarted.json 'http://localhost:8983/solr/test_collection/update/json/docs?commit=true' +curl 'http://localhost:8983/solr/test_collection/update/json/docs?commit=true' --header "Content-Type: application/json" -d @gettingstarted.json ---- or [,console] ---- -$ curl -H 'Content-Type: application/json' -X POST -d @gettingstarted.json 'http://localhost:8983/solr/test_collection/update?commit=true' +curl 'http://localhost:8983/solr/test_collection/update?commit=true' -H 'Content-Type: application/json' -d @gettingstarted.json ---- *Example: import `javabin` files* @@ -1954,7 +1954,7 @@ $ curl -H 'Content-Type: application/json' -X POST -d @gettingstarted.json 'http [,console] ---- $ bin/solr export --solr-url http://localhost:8983 -c gettingstarted --format javabin --fields id,name,manu,cat,features -$ curl -X POST --header "Content-Type: application/javabin" --data-binary @gettingstarted.javabin 'http://localhost:8983/solr/test_collection/update?commit=true' +curl 'http://localhost:8983/solr/test_collection/update?commit=true' --header "Content-Type: application/javabin" --data-binary @gettingstarted.javabin ---- == Interacting with API diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-diy.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-diy.adoc index 140b242de8d..2fa35587de9 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-diy.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-diy.adoc @@ -73,14 +73,14 @@ Add the /update/extract handler to your collection, pointing to the Tika Server [,console] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/localDocs/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/update/extract", "class": "solr.extraction.ExtractingRequestHandler", "tikaserver.url": "http://localhost:9998", "defaults": { "lowernames": "true", "captureAttr": "true" } } -}' 'http://localhost:8983/solr/localDocs/config' +}' ---- === Indexing Ideas diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc index ac81becdf0d..39816098cc2 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc @@ -168,7 +168,7 @@ At the command line, enter this curl command: [,console] ---- -$ curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"name", "type":"text_general", "multiValued":false, "stored":true}}' http://localhost:8983/solr/films/schema +curl 'http://localhost:8983/solr/films/schema' -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"name", "type":"text_general", "multiValued":false, "stored":true}}' ---- This command uses the Schema API to explicitly define a field named "name" that has the field type "text_general" (a text field). @@ -197,7 +197,7 @@ At the command line, use the Schema API again to define a copy field: [,console] ---- -$ curl -X POST -H 'Content-type:application/json' --data-binary '{"add-copy-field" : {"source":"*","dest":"_text_"}}' http://localhost:8983/solr/films/schema +curl 'http://localhost:8983/solr/films/schema' -H 'Content-type:application/json' --data-binary '{"add-copy-field" : {"source":"*","dest":"_text_"}}' ---- In the Admin UI, choose btn:[Add Copy Field], then fill out the source and destination for your field, as in this screenshot. @@ -301,7 +301,7 @@ The `curl` command below will return facet counts for the `genre_str` field: [,console] ---- -$ curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=true&facet.field=genre_str" +curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=true&facet.field=genre_str" ---- In your terminal, you'll see something like: @@ -342,7 +342,7 @@ If you wanted to control the number of items in a bucket, you could do something [,console] ---- -$ curl "http://localhost:8983/solr/films/select?=&q=\*:*&facet.field=genre_str&facet.mincount=200&facet=on&rows=0" +curl "http://localhost:8983/solr/films/select?=&q=\*:*&facet.field=genre_str&facet.mincount=200&facet=on&rows=0" ---- You should only see 4 facets returned. @@ -362,7 +362,7 @@ If we construct a query that looks like this: [,console] ---- -$ curl "http://localhost:8983/solr/films/select?q=*:*&rows=0\ +curl "http://localhost:8983/solr/films/select?q=*:*&rows=0\ &facet=true\ &facet.range=initial_release_date\ &facet.range.start=NOW/YEAR-25YEAR\ @@ -432,7 +432,7 @@ Here's how to get at the raw data for this scenario: [,console] ---- -$ curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=on&facet.pivot=genre_str,directed_by_str" +curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=on&facet.pivot=genre_str,directed_by_str" ---- This results in the following response, which shows a facet for each category and director combination: diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-five-minutes.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-five-minutes.adoc index 9d80f995f8e..fe9698e7ee5 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-five-minutes.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-five-minutes.adoc @@ -36,7 +36,7 @@ Like a database system holds data in tables, Solr holds data in collections. A c [,console] ---- -$ curl --request POST \ +curl --request POST \ --url http://localhost:8983/api/collections \ --header 'Content-Type: application/json' \ --data '{ @@ -52,7 +52,7 @@ Let us define some of the fields that our documents will contain. [,console] ---- -$ curl --request POST \ +curl --request POST \ --url http://localhost:8983/api/collections/techproducts/schema \ --header 'Content-Type: application/json' \ --data '{ @@ -76,7 +76,7 @@ A single document can be indexed as: [,console] ---- -$ curl --request POST \ +curl --request POST \ --url 'http://localhost:8983/api/collections/techproducts/update' \ --header 'Content-Type: application/json' \ --data ' { @@ -97,7 +97,7 @@ Multiple documents can be indexed in the same request: [,console] ---- -$ curl --request POST \ +curl --request POST \ --url 'http://localhost:8983/api/collections/techproducts/update' \ --header 'Content-Type: application/json' \ --data ' [ @@ -133,7 +133,7 @@ A file containing the documents can be indexed as follows: [,console] ---- -$ curl -H "Content-Type: application/json" \ +curl -H "Content-Type: application/json" \ -X POST \ -d @example/exampledocs/books.json \ --url 'http://localhost:8983/api/collections/techproducts/update?commit=true' @@ -144,7 +144,7 @@ After documents are indexed into a collection, they are not immediately availabl [,console] ---- -$ curl -X POST -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' http://localhost:8983/api/collections/techproducts/config +curl 'http://localhost:8983/api/collections/techproducts/config' -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' ---- == Make some Basic search queries diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-opennlp.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-opennlp.adoc index aced2f343f6..f90b29af850 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-opennlp.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-opennlp.adoc @@ -92,22 +92,22 @@ We need to add fields to our schema to store both the input text and the sentime [,console] ---- -$ curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl "http://localhost:8983/solr/sentiment/schema" -H 'Content-type:application/json' --data-binary '{ "add-field":{ "name":"name", "type":"string", "stored":true } -}' "http://localhost:8983/solr/sentiment/schema" +}' ---- [,console] ---- -$ curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl "http://localhost:8983/solr/sentiment/schema" -H 'Content-type:application/json' --data-binary '{ "add-field":{ "name":"name_sentiment", "type":"string", "stored":true } -}' "http://localhost:8983/solr/sentiment/schema" +}' ---- === Step 5: Upload the Model Files to Solr's FileStore @@ -116,12 +116,12 @@ Solr's FileStore provides a distributed file storage mechanism for SolrCloud. Up [,console] ---- -$ curl --data-binary @./downloads/sentiment/vocab.txt -X PUT "http://localhost:8983/api/cluster/filestore/files/models/sentiment/vocab.txt" +curl --data-binary @./downloads/sentiment/vocab.txt -X PUT "http://localhost:8983/api/cluster/filestore/files/models/sentiment/vocab.txt" ---- [,console] ---- -$ curl --data-binary @./downloads/sentiment/model.onnx -X PUT "http://localhost:8983/api/cluster/filestore/files/models/sentiment/model.onnx" +curl --data-binary @./downloads/sentiment/model.onnx -X PUT "http://localhost:8983/api/cluster/filestore/files/models/sentiment/model.onnx" ---- .Understanding Solr's FileStore @@ -138,7 +138,7 @@ Now we'll configure the update processor that will analyze sentiment during docu [,console] ---- -$ curl -X POST -H 'Content-type:application/json' -d '{ +curl "http://localhost:8983/solr/sentiment/config" -H 'Content-type:application/json' -d '{ "add-updateprocessor": { "name": "sentimentClassifier", "class": "solr.processor.DocumentCategorizerUpdateProcessorFactory", @@ -147,7 +147,7 @@ $ curl -X POST -H 'Content-type:application/json' -d '{ "source": "name", "dest": "name_sentiment" } -}' "http://localhost:8983/solr/sentiment/config" +}' ---- This configuration creates an update processor that: @@ -180,7 +180,7 @@ Let's index some sample documents to see the sentiment analysis in action: [,console] ---- -$ curl -X POST -H 'Content-type:application/json' -d '[ +curl "http://localhost:8983/solr/sentiment/update/json?processor=sentimentClassifier&commit=true" -H 'Content-type:application/json' -d '[ { "id":"good", "name": "that was an awesome movie!" @@ -189,7 +189,7 @@ $ curl -X POST -H 'Content-type:application/json' -d '[ "id":"bad", "name": "that movie was bad and terrible" } -]' "http://localhost:8983/solr/sentiment/update/json?processor=sentimentClassifier&commit=true" +]' ---- Notice that we specify the processor name with `processor=sentimentClassifier` in the URL. @@ -200,7 +200,7 @@ Query the documents to see the sentiment classifications: [,console] ---- -$ curl -X GET "http://localhost:8983/solr/sentiment/select?q=id:good" +curl -X GET "http://localhost:8983/solr/sentiment/select?q=id:good" ---- You should see the positive review classified as "very good": @@ -222,7 +222,7 @@ Check the negative review: [,console] ---- -$ curl -X GET "http://localhost:8983/solr/sentiment/select?q=id:bad" +curl -X GET "http://localhost:8983/solr/sentiment/select?q=id:bad" ---- The result should show "very bad" sentiment: @@ -357,7 +357,7 @@ You can then use this chain by default or explicitly reference it when indexing: [,console] ---- -$ curl "http://localhost:8983/solr/sentiment/update/json?update.chain=sentiment-analysis-chain" -d '...' +curl "http://localhost:8983/solr/sentiment/update/json?update.chain=sentiment-analysis-chain" -d '...' ---- === Practical Applications of Sentiment Analysis in Solr @@ -368,7 +368,7 @@ Create facets based on sentiment to understand opinion distribution: [,console] ---- -$ curl "http://localhost:8983/solr/sentiment/select?q=*:*&facet=true&facet.field=name_sentiment" +curl "http://localhost:8983/solr/sentiment/select?q=*:*&facet=true&facet.field=name_sentiment" ---- ==== Filtering by Sentiment @@ -377,7 +377,7 @@ Filter search results to show only documents with specific sentiment: [,console] ---- -$ curl "http://localhost:8983/solr/sentiment/select?q=product_type:electronics&fq=name_sentiment:very%20good" +curl "http://localhost:8983/solr/sentiment/select?q=product_type:electronics&fq=name_sentiment:very%20good" ---- ==== Boosting by Sentiment @@ -386,7 +386,7 @@ Boost documents with positive sentiment in search results: [,console] ---- -$ curl "http://localhost:8983/solr/sentiment/select?q=*:*&defType=edismax&bq=name_sentiment:very%20good^5.0" +curl "http://localhost:8983/solr/sentiment/select?q=*:*&defType=edismax&bq=name_sentiment:very%20good^5.0" ---- ==== Time-Based Sentiment Analysis @@ -395,7 +395,7 @@ Analyze sentiment trends over time using time-based queries and facets: [,console] ---- -$ curl "http://localhost:8983/solr/sentiment/select?q=*:*&facet=true&facet.range=timestamp&facet.range.start=NOW/DAY-30DAY&facet.range.end=NOW&facet.range.gap=%2B1DAY&facet.pivot=timestamp,name_sentiment" +curl "http://localhost:8983/solr/sentiment/select?q=*:*&facet=true&facet.range=timestamp&facet.range.start=NOW/DAY-30DAY&facet.range.end=NOW&facet.range.gap=%2B1DAY&facet.pivot=timestamp,name_sentiment" ---- === Performance Considerations diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-paramsets.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-paramsets.adoc index 84f3e56b169..797c21ca4ec 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-paramsets.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-paramsets.adoc @@ -40,7 +40,7 @@ We'll specify the specific schema for a couple of fields that Solr would otherwi [,console] ---- -$ curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{ +curl http://localhost:8983/solr/films/schema -H 'Content-type:application/json' --data-binary '{ "add-field" : [ { "name":"name", @@ -89,14 +89,14 @@ Show me all 'Super hero' movies: [,console] ---- -$ curl 'http://localhost:8983/solr/films/query?q=*:*&fq=genre:"Superhero movie"' +curl 'http://localhost:8983/solr/films/query?q=*:*&fq=genre:"Superhero movie"' ---- Let's see the distribution of genres across all the movies. See the facet section of the response for the counts: [,console] ---- -$ curl 'http://localhost:8983/solr/films/query?q=*:*&facet=true&facet.field=genre' +curl 'http://localhost:8983/solr/films/query?q=*:*&facet=true&facet.field=genre' ---- === Time for relevancy tuning with ParamSets : @@ -115,7 +115,7 @@ Algorithm *A* will specify using `dismax` and a `qf` parameter, while Algorithm [,console] ---- -curl http://localhost:8983/solr/films/config/params -X POST -H 'Content-type:application/json' --data-binary '{ +curl http://localhost:8983/solr/films/config/params -H 'Content-type:application/json' --data-binary '{ "set": { "algo_a":{ "defType":"dismax", diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-solrcloud.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-solrcloud.adoc index 90d215fecef..d96a6d2373e 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-solrcloud.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-solrcloud.adoc @@ -117,7 +117,7 @@ V1 API:: ==== [,console] ---- -$ curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' +curl http://host:8983/solr/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' ---- ==== @@ -126,7 +126,7 @@ V2 API:: ==== [,console] ---- -$ curl http://host:8983/api/collections/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' +curl http://host:8983/api/collections/mycollection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}' ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc index 8456d17dce2..dc93e58e971 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc @@ -222,7 +222,7 @@ To use curl, give the same URL shown in your browser in quotes on the command li [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?indent=on&q=*:*" +curl "http://localhost:8983/solr/techproducts/select?indent=on&q=*:*" ---- @@ -243,7 +243,7 @@ If you prefer curl, enter something like this: [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?q=foundation" +curl "http://localhost:8983/solr/techproducts/select?q=foundation" ---- @@ -291,7 +291,7 @@ Or, specify it with curl: [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?q=foundation&fl=id" +curl "http://localhost:8983/solr/techproducts/select?q=foundation&fl=id" ---- @@ -388,7 +388,7 @@ If you're following along with curl, note that the space between terms must be c [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?q=\"CAS+latency\"" +curl "http://localhost:8983/solr/techproducts/select?q=\"CAS+latency\"" ---- We get 2 results: @@ -449,7 +449,7 @@ The encoding for `+` is `%2B` as in: [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics%20%2Bmusic" +curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics%20%2Bmusic" ---- You should only get a single result. @@ -459,7 +459,7 @@ For curl, again, URL encode `+` as `%2B` as in: [,console] ---- -$ curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics+-music" +curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics+-music" ---- This time you get 13 results. diff --git a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc index 97d06a91a4b..d131a6d3eff 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-vectors.adoc @@ -41,7 +41,7 @@ First we need to update our schema to add the vector field type, the field to ho [,console] ---- -$ curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{ +curl http://localhost:8983/solr/films/schema -H 'Content-type:application/json' --data-binary '{ "add-field-type" : { "name":"knn_vector_10", "class":"solr.DenseVectorField", diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc index e64fc97f84a..c5d40e78fb8 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-nested-documents.adoc @@ -432,7 +432,7 @@ JSON:: ==== [source,bash] ---- -$ curl --globoff 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=id:P11!prod&fl=*,[child%20parentFilter=%22type_s:PRODUCT%22]' +curl --globoff 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=id:P11!prod&fl=*,[child%20parentFilter=%22type_s:PRODUCT%22]' { "response":{"numFound":1,"start":0,"maxScore":0.7002023,"numFoundExact":true,"docs":[ { @@ -483,7 +483,7 @@ XML:: ==== [source,bash] ---- -$ curl --globoff 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=id:P11!prod&fl=*,[child%20parentFilter=%22type_s:PRODUCT%22]&wt=xml' +curl --globoff 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=id:P11!prod&fl=*,[child%20parentFilter=%22type_s:PRODUCT%22]&wt=xml' <?xml version="1.0" encoding="UTF-8"?> <response> diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc index 1a50f8f14c6..37929b3c419 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-tika.adoc @@ -104,7 +104,7 @@ The commands below will start Solr, create a core/collection named `gettingstart bin/solr start -e schemaless -Dsolr.modules=extraction # Configure the handler -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/gettingstarted/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/update/extract", "class": "solr.extraction.ExtractingRequestHandler", @@ -114,7 +114,7 @@ curl -X POST -H 'Content-type:application/json' -d '{ "captureAttr":"true" } } -}' 'http://localhost:8983/solr/gettingstarted/config' +}' ---- Once Solr is started, you can use curl to send a sample PDF included with Solr via HTTP POST: diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-update-handlers.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-update-handlers.adoc index 758baad611f..87d75e13d74 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-update-handlers.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/indexing-with-update-handlers.adoc @@ -60,7 +60,7 @@ The simplest way to add documents via JSON is to send each document individually [source,bash] ---- -curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update/json/docs' --data-binary ' +curl 'http://localhost:8983/solr/my_collection/update/json/docs' -H 'Content-Type: application/json' --data-binary ' { "id": "1", "title": "Doc 1" @@ -73,7 +73,7 @@ Adding multiple documents at one time via JSON can be done via a JSON Array of J [source,bash] ---- -curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update' --data-binary ' +curl 'http://localhost:8983/solr/my_collection/update' -H 'Content-Type: application/json' --data-binary ' [ { "id": "1", @@ -100,7 +100,7 @@ Multiple commands, adding and deleting documents, may be contained in one messag [source,bash,subs="verbatim,callouts"] ---- -curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update' --data-binary ' +curl 'http://localhost:8983/solr/my_collection/update' -H 'Content-Type: application/json' --data-binary ' { "add": { "doc": { @@ -494,9 +494,9 @@ One example usage would be to copy a Solr 1.3 index (which does not have CSV res [source,bash] ---- -$ curl -o standard_solr_xml_format.xml "http://localhost:8983/solr/techproducts/select?q=ipod&fl=id,cat,name,popularity,price,score&wt=xml" +curl -o standard_solr_xml_format.xml "http://localhost:8983/solr/techproducts/select?q=ipod&fl=id,cat,name,popularity,price,score&wt=xml" -$ curl -X POST -H "Content-Type: text/xml" -d @standard_solr_xml_format.xml "http://localhost:8983/solr/techproducts/update/xslt?commit=true&tr=updateXml.xsl" +curl "http://localhost:8983/solr/techproducts/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml" -d @standard_solr_xml_format.xml ---- NOTE: You can see the opposite export/import cycle using the `tr` parameter in the xref:query-guide:response-writers.adoc#xslt-writer-example[Response Writer XSLT example]. diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc index 46b81958ddc..fa32696c0d9 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc @@ -165,7 +165,7 @@ All of the <<atomic-updates,Atomic Update operations>> mentioned above are suppo [source,bash] ---- -curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ +curl 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ { "id": "P11!S31", "_root_": "P11!prod", @@ -180,7 +180,7 @@ As with normal (multiValued) fields, the `set` keyword can be used to replace al [source,bash] ---- -curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ +curl 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ { "id": "P22!S22", "_root_": "P22!prod", @@ -202,7 +202,7 @@ As with normal (multiValued) fields, the `add` keyword can be used to add additi [source,bash] ---- -curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ +curl 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ { "id": "P11!S21", "_root_": "P11!prod", @@ -221,7 +221,7 @@ As with normal (multiValued) fields, the `remove` keyword can be used to remove [source,bash] ---- -curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ +curl 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[ { "id": "P11!S21", "_root_": "P11!prod", @@ -356,7 +356,7 @@ Following are some examples using `versions=true` in queries: [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?versions=true&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?versions=true&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [ { "id" : "aaa" }, { "id" : "bbb" } ]' ---- @@ -373,7 +373,7 @@ Because we added `versions=true` to the request, the response shows the document [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?_version_=999999&versions=true&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?_version_=999999&versions=true&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [{ "id" : "aaa", "foo_s" : "update attempt with wrong existing version" }]' ---- @@ -394,7 +394,7 @@ We get an error in response. [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?_version_=1632740120218042368&versions=true&commit=true&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?_version_=1632740120218042368&versions=true&commit=true&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [{ "id" : "aaa", "foo_s" : "update attempt with correct existing version" }]' ---- @@ -409,7 +409,7 @@ Now we've sent an update with a value for `\_version_` that matches the value in Because we included `versions=true` to the update request, the response includes a different value for the `\_version_` field. [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [{ "id" : "aaa", _version_ : 100, "foo_s" : "update attempt with wrong existing version embedded in document" }]' ---- @@ -430,7 +430,7 @@ This is useful when documents are sent in a batch and different `\_version_` val [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [{ "id" : "aaa", _version_ : 1632740462042284032, "foo_s" : "update attempt with correct version embedded in document" }]' ---- @@ -448,7 +448,7 @@ This is useful when documents are sent in a batch and different `\_version_` val [source,bash] ---- -$ curl 'http://localhost:8983/solr/techproducts/query?q=*:*&fl=id,_version_&omitHeader=true' +curl 'http://localhost:8983/solr/techproducts/query?q=*:*&fl=id,_version_&omitHeader=true' ---- [source,json] @@ -467,7 +467,7 @@ Finally, we can issue a query that requests the `\_version_` field be included i [source,bash] ---- -$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?versions=true&_version_=-1&failOnVersionConflicts=false&omitHeader=true' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/update?versions=true&_version_=-1&failOnVersionConflicts=false&omitHeader=true' -H 'Content-Type: application/json' --data-binary ' [ { "id" : "aaa" }, { "id" : "ccc" } ]' ---- diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/reindexing.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/reindexing.adoc index 0b0e5045fb7..0f4795a1322 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/reindexing.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/reindexing.adoc @@ -133,7 +133,7 @@ The best approach is to first delete everything from the index, and then index y You can delete all documents with a "delete-by-query", such as this: [source,bash] -curl -X POST -H 'Content-Type: application/json' --data-binary '{"delete":{"query":"*:*" }}' http://localhost:8983/solr/my_collection/update +curl 'http://localhost:8983/solr/my_collection/update' -H 'Content-Type: application/json' --data-binary '{"delete":{"query":"*:*" }}' It's important to verify that *all* documents have been deleted, as that ensures the Lucene index segments have been deleted as well. diff --git a/solr/solr-ref-guide/modules/indexing-guide/pages/schema-api.adoc b/solr/solr-ref-guide/modules/indexing-guide/pages/schema-api.adoc index aa4047dc292..8a305719fe3 100644 --- a/solr/solr-ref-guide/modules/indexing-guide/pages/schema-api.adoc +++ b/solr/solr-ref-guide/modules/indexing-guide/pages/schema-api.adoc @@ -108,12 +108,12 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field":{ "name":"sell_by", "type":"pdate", "stored":true } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -145,9 +145,9 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "delete-field" : { "name":"sell_by" } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -179,12 +179,12 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "replace-field":{ "name":"sell_by", "type":"date", "stored":false } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -217,12 +217,12 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-dynamic-field":{ "name":"*_s", "type":"string", "stored":true } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -253,9 +253,9 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "delete-dynamic-field":{ "name":"*_s" } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -287,12 +287,12 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "replace-dynamic-field":{ "name":"*_s", "type":"text_general", "stored":false } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -326,7 +326,7 @@ V1 API with Single Analysis:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field-type" : { "name":"myNewTxtField", "class":"solr.TextField", @@ -341,7 +341,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ "filters":[{ "name":"wordDelimiter", "preserveOriginal":"0" }]}} -}' http://localhost:8983/solr/techproducts/schema +}' ---- Note in this example that we have only defined a single analyzer section that will apply to index analysis and query analysis. @@ -355,7 +355,7 @@ As in this example: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field-type":{ "name":"myNewTextField", "class":"solr.TextField", @@ -366,7 +366,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ "queryAnalyzer":{ "tokenizer":{ "name":"keyword" }}} -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -404,9 +404,9 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "delete-field-type":{ "name":"myNewTxtField" } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -439,7 +439,7 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "replace-field-type":{ "name":"myNewTxtField", "class":"solr.TextField", @@ -447,7 +447,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ "analyzer":{ "tokenizer":{ "name":"standard" }}} -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -510,11 +510,11 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-copy-field":{ "source":"shelf", "dest":[ "location", "catchall" ]} -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -523,11 +523,11 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/api/collections/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-copy-field":{ "source":"shelf", "dest":[ "location", "catchall" ]} -}' http://localhost:8983/api/collections/techproducts/schema +}' ---- ==== ====== @@ -548,9 +548,9 @@ V1 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "delete-copy-field":{ "source":"shelf", "dest":"location" } -}' http://localhost:8983/solr/techproducts/schema +}' ---- ==== @@ -559,9 +559,9 @@ V2 API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/api/collections/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "delete-copy-field":{ "source":"shelf", "dest":"location" } -}' http://localhost:8983/api/collections/techproducts/schema +}' ---- ==== ====== @@ -580,7 +580,7 @@ First, the commands can simply be made serially, as in this request to create a [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field-type":{ "name":"myNewTxtField", "class":"solr.TextField", @@ -599,14 +599,14 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ "name":"sell_by", "type":"myNewTxtField", "stored":true } -}' http://localhost:8983/solr/techproducts/schema +}' ---- Multiple commands of the same type may be repeated, as in this example: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field":{ "name":"shelf", "type":"myNewTxtField", @@ -618,14 +618,14 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ "add-copy-field":{ "source":"shelf", "dest":[ "location", "catchall" ]} -}' http://localhost:8983/solr/techproducts/schema +}' ---- Commands sharing a type can also be grouped together within a list: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary '{ +curl 'http://localhost:8983/solr/techproducts/schema' -H 'Content-type:application/json' --data-binary '{ "add-field":[ { "name":"shelf", "type":"myNewTxtField", @@ -633,7 +633,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ { "name":"location", "type":"myNewTxtField", "stored":true }] -}' http://localhost:8983/solr/techproducts/schema +}' ---- Bulk schema operations are also supported in Solr's v2 API, using a slightly different syntax. @@ -641,7 +641,7 @@ Individual operations are specified as elements within a list, with the operatio [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary ' +curl 'http://localhost:8983/solr/techproducts/schema/bulk' -H 'Content-type:application/json' --data-binary ' [ { "operationType": "add-field" @@ -660,7 +660,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary ' "source": "shelf", "destinations": ["location", "catchall"] } - ]' http://localhost:8983/solr/techproducts/schema/bulk + ]' ---- === Schema Changes Among Replicas diff --git a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc index 8b00284b552..4a42f97cbe3 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc @@ -1262,7 +1262,7 @@ EOF + [source,sh] ---- -curl -s -X POST "http://localhost:8983/solr/vectors/update?commit=true" \ +curl -s "http://localhost:8983/solr/vectors/update?commit=true" \ -H "Content-Type: application/json" \ -d '[ {"id": "doc1", "article_vector": [0.35648, 0.11664, 0.85660, 0.25043, 0.80778, 0.08031, 0.48444, 0.39083]}, diff --git a/solr/solr-ref-guide/modules/query-guide/pages/json-combined-query-dsl.adoc b/solr/solr-ref-guide/modules/query-guide/pages/json-combined-query-dsl.adoc index 61b7aed0b82..33f841cd2cc 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/json-combined-query-dsl.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/json-combined-query-dsl.adoc @@ -92,7 +92,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "queries": { "lexical1": { diff --git a/solr/solr-ref-guide/modules/query-guide/pages/json-facet-api.adoc b/solr/solr-ref-guide/modules/query-guide/pages/json-facet-api.adoc index b08efe0228f..e2f0568cdfb 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/json-facet-api.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/json-facet-api.adoc @@ -963,7 +963,7 @@ Increasing the `overrequest` can help improve the accuracy of the top buckets. .Sample Documents [source,bash,subs="verbatim,callouts"] ---- -curl -sS -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -d '[ +curl -sS 'http://localhost:8983/solr/gettingstarted/update?commit=true' -d '[ {"id":"01",age:15,"state":"AZ","hobbies":["soccer","painting","cycling"]}, {"id":"02",age:22,"state":"AZ","hobbies":["swimming","darts","cycling"]}, {"id":"03",age:27,"state":"AZ","hobbies":["swimming","frisbee","painting"]}, @@ -986,7 +986,7 @@ curl -sS -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' .Example Query [source,bash,subs="verbatim,callouts"] ---- -curl -sS -X POST http://localhost:8983/solr/gettingstarted/query -d 'rows=0&q=*:* +curl -sS http://localhost:8983/solr/gettingstarted/query -d 'rows=0&q=*:* &back=*:* # <1> &fore=age:[35 TO *] # <2> &json.facet={ diff --git a/solr/solr-ref-guide/modules/query-guide/pages/json-query-dsl.adoc b/solr/solr-ref-guide/modules/query-guide/pages/json-query-dsl.adoc index a52300aac34..87d5dd1bdcf 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/json-query-dsl.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/json-query-dsl.adoc @@ -70,7 +70,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query" : "name:iPod" }' @@ -96,7 +96,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": "{!lucene df=name v=iPod}" }' @@ -122,7 +122,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": { "lucene": { @@ -185,7 +185,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query" : { "boost": { @@ -216,7 +216,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": { "boost": { @@ -256,7 +256,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": { "bool": { @@ -292,7 +292,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": { "bool": { @@ -321,7 +321,7 @@ Example of referencing <<Additional Queries,additional queries>>, <<Tagging in J [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "queries": { "query_filters":[ // 1. @@ -353,7 +353,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "query": { "bool": { @@ -395,7 +395,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/query -d ' +curl http://localhost:8983/solr/techproducts/query -d ' { "queries": { "electronic": {"field": {"f":"cat", "query":"electronics"}}, @@ -442,7 +442,7 @@ curl:: ==== [source,bash] ---- -curl -X POST http://localhost:8983/solr/techproducts/select -d ' +curl http://localhost:8983/solr/techproducts/select -d ' { "query": "*:*", "filter": [ diff --git a/solr/solr-ref-guide/modules/query-guide/pages/morelikethis.adoc b/solr/solr-ref-guide/modules/query-guide/pages/morelikethis.adoc index 6d0e83ce0f1..767876f1dfe 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/morelikethis.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/morelikethis.adoc @@ -211,13 +211,13 @@ Config API:: ==== [source,bash] ---- -curl -X POST -H 'Content-type:application/json' -d '{ +curl 'http://localhost:8983/solr/gettingstarted/config' -H 'Content-type:application/json' -d '{ "add-requesthandler": { "name": "/mlt", "class": "solr.MoreLikeThisHandler", "defaults": {"mlt.fl": "text"} } -}' http://localhost:8983/solr/gettingstarted/config +}' ---- ==== ====== diff --git a/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc b/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc index 609de61d82f..769744887ea 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc @@ -162,31 +162,31 @@ If you wanted to do this by hand using curl, the sequence of requests would look [source,plain] ---- -$ curl '...&rows=10&sort=id+asc&cursorMark=*' +curl '...&rows=10&sort=id+asc&cursorMark=*' { "response":{"numFound":32,"start":0,"docs":[ // ... 10 docs here ... ]}, "nextCursorMark":"AoEjR0JQ"} -$ curl '...&rows=10&sort=id+asc&cursorMark=AoEjR0JQ' +curl '...&rows=10&sort=id+asc&cursorMark=AoEjR0JQ' { "response":{"numFound":32,"start":0,"docs":[ // ... 10 more docs here ... ]}, "nextCursorMark":"AoEpVkRCREIxQTE2"} -$ curl '...&rows=10&sort=id+asc&cursorMark=AoEpVkRCREIxQTE2' +curl '...&rows=10&sort=id+asc&cursorMark=AoEpVkRCREIxQTE2' { "response":{"numFound":32,"start":0,"docs":[ // ... 10 more docs here ... ]}, "nextCursorMark":"AoEmbWF4dG9y"} -$ curl '...&rows=10&sort=id+asc&cursorMark=AoEmbWF4dG9y' +curl '...&rows=10&sort=id+asc&cursorMark=AoEmbWF4dG9y' { "response":{"numFound":32,"start":0,"docs":[ // ... 2 docs here because we've reached the end. ]}, "nextCursorMark":"AoEpdmlld3Nvbmlj"} -$ curl '...&rows=10&sort=id+asc&cursorMark=AoEpdmlld3Nvbmlj' +curl '...&rows=10&sort=id+asc&cursorMark=AoEpdmlld3Nvbmlj' { "response":{"numFound":32,"start":0,"docs":[ // no more docs here, and note that the nextCursorMark diff --git a/solr/solr-ref-guide/modules/query-guide/pages/response-writers.adoc b/solr/solr-ref-guide/modules/query-guide/pages/response-writers.adoc index 0aff169b739..14fc69134c1 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/response-writers.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/response-writers.adoc @@ -264,7 +264,7 @@ could round trip your data via: [source,bash] ---- curl -o docs_formatted_as_solr_add.xml "http://localhost:8983/solr/techproducts/select?q=ipod&fl=id,cat,name,popularity,price,score&wt=xslt&tr=updateXml.xsl" -curl -X POST -H "Content-Type: text/xml" -d @docs_formatted_as_solr_add.xml "http://localhost:8983/solr/techproducts/update?commitWithin=1000&overwrite=true" +curl "http://localhost:8983/solr/techproducts/update?commitWithin=1000&overwrite=true" -H "Content-Type: text/xml" -d @docs_formatted_as_solr_add.xml ---- Lastly, the `luke.xsl` transformation demonstrates that you can apply very sophisticated transformations: `\http://localhost:8983/solr/techproducts/admin/luke?wt=xslt&tr=luke.xsl` diff --git a/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc b/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc index 879663b17ac..8cd15cbfafd 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc @@ -43,7 +43,7 @@ A simple query matching all documents with a description that includes "staplers [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=description_t:staplers' +curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=description_t:staplers' { "response":{"numFound":1,"start":0,"maxScore":0.30136836,"numFoundExact":true,"docs":[ { @@ -59,7 +59,7 @@ Note that the `numFound` has not changed, we are still matching the same set of [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=description_t:staplers&fl=*,[child]' +curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=description_t:staplers&fl=*,[child]' { "response":{"numFound":1,"start":0,"maxScore":0.30136836,"numFoundExact":true,"docs":[ { @@ -112,7 +112,7 @@ Let's consider again the `description_t:staplers` query used above -- if we wrap [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!child parentPath="/"}description_t:staplers' +curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!child parentPath="/"}description_t:staplers' { "response":{"numFound":5,"start":0,"maxScore":0.30136836,"numFoundExact":true,"docs":[ { @@ -153,7 +153,7 @@ In the query below, we search for all children of `skus` with a `price_i` less t [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!child parentPath="/skus"}price_i:[* TO 50]' +curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!child parentPath="/skus"}price_i:[* TO 50]' { "response":{"numFound":1,"start":0,"maxScore":1.0,"numFoundExact":true,"docs":[ { @@ -174,7 +174,7 @@ Let's first consider this example of searching for all "manual" type documents t [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=pages_i:1' +curl 'http://localhost:8983/solr/gettingstarted/select?omitHeader=true&q=pages_i:1' { "response":{"numFound":3,"start":0,"maxScore":1.0,"numFoundExact":true,"docs":[ { @@ -202,7 +202,7 @@ We can wrap that query in a `{!parent}` query with `parentPath="/"` to return th [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!parent parentPath="/"}pages_i:1' +curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!parent parentPath="/"}pages_i:1' { "response":{"numFound":2,"start":0,"maxScore":1.4E-45,"numFoundExact":true,"docs":[ { @@ -226,7 +226,7 @@ Adding `childPath="manuals"` constrains the child query to only docs nested at ` [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!parent parentPath="/skus" childPath="manuals"}pages_i:1' +curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' --data-urlencode 'q={!parent parentPath="/skus" childPath="manuals"}pages_i:1' { "response":{"numFound":2,"start":0,"maxScore":1.4E-45,"numFoundExact":true,"docs":[ { @@ -256,7 +256,7 @@ Here for example is a query where: [source,text] ---- -$ curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' -d 'fq=color_s:RED' --data-urlencode 'q={!child parentPath="/" filters=$parent_fq}' --data-urlencode 'parent_fq={!parent parentPath="/"}content_t:"lifetime guarantee"' -d 'fl=*,[child]' +curl 'http://localhost:8983/solr/gettingstarted/select' -d 'omitHeader=true' -d 'fq=color_s:RED' --data-urlencode 'q={!child parentPath="/" filters=$parent_fq}' --data-urlencode 'parent_fq={!parent parentPath="/"}content_t:"lifetime guarantee"' -d 'fl=*,[child]' { "response":{"numFound":1,"start":0,"maxScore":1.4E-45,"numFoundExact":true,"docs":[ { diff --git a/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc b/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc index 29992f99aa9..da5afbcaec3 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/spatial-search.adoc @@ -71,7 +71,9 @@ However, it's much bulkier than the raw coordinates for such simple data. Using the `bin/solr post` tool: [,console] +---- $ bin/solr post -t "application/json" --solr-url http://localhost:8983 --name mycollection --params "format=geojson" /path/to/geojson.file +---- The key parameter to pass in with your request is: diff --git a/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc b/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc index 2cb2e0589fe..ba11e5ab27c 100644 --- a/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc +++ b/solr/solr-ref-guide/modules/query-guide/pages/tagger-handler.adoc @@ -215,7 +215,7 @@ Schema configuration: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' http://localhost:8983/solr/geonames/schema -d '{ +curl http://localhost:8983/solr/geonames/schema -H 'Content-type:application/json' -d '{ "add-field-type":{ "name":"tag", "class":"solr.TextField", @@ -253,7 +253,7 @@ Configure a custom Solr Request Handler: [source,bash] ---- -curl -X POST -H 'Content-type:application/json' http://localhost:8983/solr/geonames/config -d '{ +curl http://localhost:8983/solr/geonames/config -H 'Content-type:application/json' -d '{ "add-requesthandler" : { "name": "/tag", "class":"solr.TaggerRequestHandler", @@ -286,8 +286,8 @@ or using curl: [,console] ---- -$ curl -X POST --data-binary @/path/to/cities1000.txt -H 'Content-type:application/csv' \ - 'http://localhost:8983/solr/geonames/update?commit=true&optimize=true&maxSegments=1&separator=%09&encapsulator=%00&fieldnames=id,name,,alternative_names,latitude,longitude,,,countrycode,,,,,,population,elevation,,timezone,lastupdate' +curl 'http://localhost:8983/solr/geonames/update?commit=true&optimize=true&maxSegments=1&separator=%09&encapsulator=%00&fieldnames=id,name,,alternative_names,latitude,longitude,,,countrycode,,,,,,population,elevation,,timezone,lastupdate' \ + --data-binary @/path/to/cities1000.txt -H 'Content-type:application/csv' ---- That might take around 35 seconds; it depends. @@ -308,7 +308,7 @@ options, see the earlier documentation. [,console] ---- -$ curl -X POST \ +curl \ 'http://localhost:8983/solr/geonames/tag?overlaps=NO_SUB&tagsLimit=5000&fl=id,name,countrycode&wt=json&indent=on' \ -H 'Content-Type:text/plain' -d 'Hello New York City' ---- diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-8.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-8.adoc index 61f78985e9e..3ed736b75be 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-8.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-8.adoc @@ -243,7 +243,9 @@ The default replica placement strategy can be changed to use autoscaling again b + [source,bash] ---- -curl -X POST -H 'Content-type:application/json' --data-binary ' +curl 'http://$SOLR_HOST:$SOLR_PORT/api/cluster' \ + -H 'Content-type:application/json' \ + --data-binary ' { "set-obj-property": { "defaults" : { @@ -252,7 +254,7 @@ curl -X POST -H 'Content-type:application/json' --data-binary ' } } } - }' http://$SOLR_HOST:$SOLR_PORT/api/cluster + }' ---- * A new command-line option is available via `bin/solr autoscaling` to calculate autoscaling policy suggestions and diagnostic information outside of the running Solr cluster. This option can use the existing autoscaling policy, or test the impact of a new one from a file located on the server filesystem. diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc index 037c7339fe1..45246a1a747 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc @@ -777,7 +777,9 @@ If your cluster is running 8.6.0 and *not using an explicit autoscaling policy*, Replace `localhost:8983` with your Solr endpoint. + [source,text] -curl -X POST -H 'Content-type:application/json' -d '{set-cluster-policy : [], set-cluster-preferences : []}' http://localhost:8983/api/cluster/autoscaling +curl 'http://localhost:8983/api/cluster/autoscaling' \ + -H 'Content-type:application/json' \ + -d '{set-cluster-policy : [], set-cluster-preferences : []}' + This information is only relevant for users upgrading from 8.6.0. If upgrading from an earlier version to 8.6.1+, this warning can be ignored.
