Using SolrJ, I'm trying to figure out how to include request parameters
when adding a document with SolrCloudClient.add().

Here is what I was doing when using HttpSolrClient instead of
SolrCloudClient:

HttpSolrClient client = new HttpSolrClient.Builder("
http://hostname.com:8983/solr/corename";)
    .withHttpClient(HttpClientBuilder.create().build())
    .build();
client.getInvariantParams().set("param1_name", "param1_value");
client.getInvariantParams().set("param2_name", "param2_value");

SolrInputDocument sDoc = new SolrInputDocument();
// Populate sDoc fields.
UpdateResponse response = client.add(sDoc);


SolrCloudClient doesn't appear to have any methods for adding parameters,
so I'm not sure how I can do it. When doing reads, I add parameters to the
SolrQuery object, but when adding a SolrInputDocument object, I don't have
that option.

The only thing I can think of is that maybe adding them as fields in the
SolrInputDocument object would do the trick, but would that actually work
the same?

Reply via email to