lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent P <brent.pear...@gmail.com>
Subject Adding request parameters when using SolrCloudClient.add()
Date Tue, 30 Aug 2016 21:28:24 GMT
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?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message