(
SolrClient solrClient, String updatePath, String jsonBody)
| 396 | |
| 397 | private static final String JSON_CONTENT_TYPE = "application/json"; |
| 398 | |
| 399 | public static NamedList<Object> postJsonToSolr( |
| 400 | SolrClient solrClient, String updatePath, String jsonBody) throws Exception { |
| 401 | ContentStreamBase.StringStream contentStream = new ContentStreamBase.StringStream(jsonBody); |
| 402 | contentStream.setContentType(JSON_CONTENT_TYPE); |
| 403 | ContentStreamUpdateRequest req = new ContentStreamUpdateRequest(updatePath); |
| 404 | req.addContentStream(contentStream); |
| 405 | return solrClient.request(req); |
| 406 | } |
| 407 | |
| 408 | private static final long MS_IN_MIN = 60 * 1000L; |
no test coverage detected