MCPcopy Create free account
hub / github.com/apache/solr / postJsonToSolr

Method postJsonToSolr

solr/core/src/java/org/apache/solr/cli/SolrCLI.java:398–405  ·  view source on GitHub ↗
(
      SolrClient solrClient, String updatePath, String jsonBody)

Source from the content-addressed store, hash-verified

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;

Callers 5

deployClusterPackageMethod · 0.95
undeployMethod · 0.95
runImplMethod · 0.95
runExampleMethod · 0.95

Calls 3

addContentStreamMethod · 0.95
setContentTypeMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected