File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
solrj/src/java/org/apache/solr/client/solrj/impl Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ Other Changes
52
52
* SOLR-16505: Use Jetty HTTP2 for index replication and other "recovery" operations
53
53
(Sanjay Dutt, David Smiley)
54
54
55
+ * GITHUB#2454: Refactor preparePutOrPost method in HttpJdkSolrClient (Andy Webb)
56
+
55
57
================== 9.6.0 ==================
56
58
New Features
57
59
---------------------
Original file line number Diff line number Diff line change @@ -320,15 +320,17 @@ private PreparedRequest preparePutOrPost(
320
320
321
321
InputStream is = streams .iterator ().next ().getStream ();
322
322
bodyPublisher = HttpRequest .BodyPublishers .ofInputStream (() -> is );
323
- } else if (queryParams != null && urlParamNames != null ) {
324
- ModifiableSolrParams requestParams = queryParams ;
325
- queryParams = calculateQueryParams (urlParamNames , requestParams );
326
- queryParams .add (calculateQueryParams (solrRequest .getQueryParams (), requestParams ));
327
- // note the toQueryString() method adds a leading question mark which needs to be removed here
328
- bodyPublisher =
329
- HttpRequest .BodyPublishers .ofString (requestParams .toQueryString ().substring (1 ));
330
323
} else {
331
- bodyPublisher = HttpRequest .BodyPublishers .noBody ();
324
+ // move any params specified in urlParamNames or solrRequest from queryParams into urlParams
325
+ ModifiableSolrParams urlParams = calculateQueryParams (urlParamNames , queryParams );
326
+ urlParams .add (calculateQueryParams (solrRequest .getQueryParams (), queryParams ));
327
+
328
+ // put the remaining params in the request body
329
+ // note the toQueryString() method adds a leading question mark which needs to be removed here
330
+ bodyPublisher = HttpRequest .BodyPublishers .ofString (queryParams .toQueryString ().substring (1 ));
331
+
332
+ // replace queryParams with the selected set
333
+ queryParams = urlParams ;
332
334
}
333
335
334
336
decorateRequest (reqb , solrRequest );
You can’t perform that action at this time.
0 commit comments