You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/20 13:40:33 UTC

[GitHub] [lucene-solr] epugh commented on a change in pull request #2401: SOLR-11646: Add v2 examples for collections API

epugh commented on a change in pull request #2401:
URL: https://github.com/apache/lucene-solr/pull/2401#discussion_r579658755



##########
File path: solr/solr-ref-guide/src/collection-management.adoc
##########
@@ -22,7 +22,42 @@ A collection is a single logical index that uses a single Solr configuration fil
 [[create]]
 == CREATE: Create a Collection
 
-`/admin/collections?action=CREATE&name=_name_`
+The CREATE action is used to create new collection of data.
+
+[.dynamic-tabs]
+--
+[example.tab-pane#v1createcollection]
+====
+[.tab-label]*V1 API*
+
+With the v1 API, the `create` command must be capitalized as `CREATE`:
+
+[source,bash]
+----
+http://localhost:8983/solr/admin/collections?action=CREATE&name=newCollection
+
+----
+====
+
+[example.tab-pane#v2createcollection]
+====
+[.tab-label]*V2 API*
+
+With the v2 API, the `create` command is provided as part of the JSON data that contains the required parameters:
+
+[source,bash]
+----
+curl -X POST http://localhost:8983/api/collections?omitHeader=true -H 'Content-Type: application/json' -d'
+  {
+    "create": {
+      "name": "newCollection",
+      "numShards": 1

Review comment:
       Thanks for reviewing!   So, I just tried the v1 api call, and it turns out NOW you need to have numShards, otherwise you get `"numShards is a required param (when using CompositeId router).`, so updating the v1 api example.   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org