janhoy commented on code in PR #4177:
URL: https://github.com/apache/solr/pull/4177#discussion_r4530589513


##########
solr/core/src/java/org/apache/solr/cli/CreateTool.java:
##########
@@ -346,7 +346,7 @@ private void createCollection(CloudSolrClient 
cloudSolrClient, CreateParams para
               + " using the Configsets V2 API");
       var uploadReq =
           new ConfigsetsApi.UploadConfigSet(
-              confName, new 
ByteArrayInputStream(Utils.zipDirectory(confPath)));
+              confName, new 
ByteArrayInputStream(Utils.zipDirectory(confPath)), "application/zip");

Review Comment:
   Constant instead of string? Either from Jetty or from JDK



##########
solr/core/src/java/org/apache/solr/cli/packagemanager/PackageUtils.java:
##########
@@ -91,7 +91,7 @@ public static ObjectMapper getMapper() {
   public static void postFile(SolrClient client, ByteBuffer buffer, String 
name, String sig)
       throws SolrServerException, IOException {
     try (final var stream = new ByteBufferInputStream(buffer)) {
-      final var uploadReq = new FileStoreApi.UploadFile(name, stream);
+      final var uploadReq = new FileStoreApi.UploadFile(name, stream, 
"application/octet-stream");

Review Comment:
   Use a constant in place of string?



##########
solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java:
##########
@@ -1219,7 +1219,7 @@ private int uploadGivenConfigSet(
       try (InputStream fileBytes = new FileInputStream(file.toFile())) {
         // Create and execute the upload request using generated client
         final var uploadRequest =
-            new ConfigsetsApi.UploadConfigSet(configSetName + suffix, 
fileBytes);
+            new ConfigsetsApi.UploadConfigSet(configSetName + suffix, 
fileBytes, "application/zip");

Review Comment:
   Constant? Also line 1283



##########
solr/core/src/test/org/apache/solr/filestore/TestDistribFileStore.java:
##########
@@ -348,7 +348,9 @@ public static void uploadKey(byte[] bytes, String path, 
MiniSolrCloudCluster clu
   public static UploadToFileStoreResponse postFile(
       SolrClient client, ByteBuffer buffer, String name, String sig)
       throws SolrServerException, IOException {
-    final var uploadReq = new FileStoreApi.UploadFile(name, new 
ByteBufferInputStream(buffer));
+    final var uploadReq =
+        new FileStoreApi.UploadFile(
+            name, new ByteBufferInputStream(buffer), 
"application/octet-stream");

Review Comment:
   Constant?



##########
solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc:
##########
@@ -64,6 +64,9 @@ May be specified as a single value, or as a list.
 Increments or decrements a numeric field's value by a specific amount, 
specified as a single integer or float.
 Positive amounts increment the field's value, and negative decrement.
 
+NOTE: Atomic update syntax is supported exclusively on the `/update` endpoint. 

Review Comment:
   I don't remember why this was. And is it precise to say "exclusively on the 
`/update` endpoint", when the `/update` endpoint now is a dispatcher to various 
sub handlers, which behave quite differently. It is only the json one with 
`Content-Type: application/json` that handles atomic update???



##########
solr/solr-ref-guide/modules/indexing-guide/pages/transforming-and-indexing-custom-json.adoc:
##########
@@ -134,52 +135,21 @@ curl 
'http://localhost:8983/solr/techproducts/update/json/docs'\
 ----
 ====
 
-V2 API User-Managed / Standalone Solr::
+V2 API::
 +
 ====
 [source,bash]
 ----
-curl 'http://localhost:8983/api/cores/techproducts/update/json/docs'\
-'?split=/exams'\
-'&f=first:/first'\
-'&f=last:/last'\
-'&f=grade:/grade'\
-'&f=subject:/exams/subject'\
-'&f=test:/exams/test'\
-'&f=marks:/exams/marks'\
- -H 'Content-type:application/json' -d '
-{
-  "first": "John",
-  "last": "Doe",
-  "grade": 8,
-  "exams": [
-    {
-      "subject": "Maths",
-      "test"   : "term1",
-      "marks"  : 90},
-    {
-      "subject": "Biology",
-      "test"   : "term1",
-      "marks"  : 86}
-  ]
-}'
-----
-====
-
-V2 API SolrCloud::
-+
-====
-[source,bash]
-----
-curl 'http://localhost:8983/api/collections/techproducts/update/json/docs'\
+curl 'http://localhost:8983/api/collections/techproducts/update/json'\

Review Comment:
   It's a pity that v2 paths changelike this between v1 and v2 but I guess we 
considered all alternatives...



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to