I am trying to post the json update request using
java.net.HttpURLConnection.

Parameters I am using:

url : http://localhost:8983/solr/update/json?commit=true

 String data =
            "[{\"id\" : \"TestDoc7\", \"title\" : \"test 7\"}, {\"id\" :
\"TestDoc8\", \"title\" : \"another test 8\"}]";

uri += "&" + data;

String requestType = "POST";


Header info:
"Content-type", "application/json"
"Content-Length", "" + data.length()


I see, the request going to the solr server but the data is not being
persisted.

I was able to add the same documents with curl, I am sure there is something
stupid.

Any pointers  on what might be the mistake.

Thanks,
Sharath

Reply via email to