I am using httpclient to query solr server from java code. Now I just want to convert all of my code using solrj library. I am not able to find any proper documentation for it. My existing code is like this
HttpURLConnection conn = (HttpURLConnection) new URL(url.toString()).openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Accept", "*/*");
conn.setInstanceFollowRedirects(false);
OutputStream os = conn.getOutputStream();
os.write(inputJson.getBytes());
os.flush();
os.close();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
//read resp from rd
How to do the same using solrj? Here is documentation for the same to do by using curl JSON Request API
I want to send inputJson String as request body. This Json String may contain whatever dynamic key values. It is doable as I have shown using http rest call. But how to do same using solrj?