Also I believe you have to set the MIME type on your post. You might want to refer to the server side logs to see what Solr is saying about your request. There likely will be a descriptive error there.
Michael Della Bitta ------------------------------------------------ Appinions 18 East 41st Street, 2nd Floor New York, NY 10017-6271 www.appinions.com Where Influence Isn’t a Game On Tue, Oct 30, 2012 at 11:44 AM, Gora Mohanty <g...@mimirtech.com> wrote: > On 30 October 2012 20:16, Amit Mallik <amit.mal...@gmail.com> wrote: >> Hi I am trying to index using AJAX basically jquery. >> Below is my code >> try { >> $.ajax({ >> type: "POST", >> url: >> "http://myserver:8080/solr/update?commit=true"<http://myserver:8080/solr/update?commit=true>, >> >> data: "<add><doc><field name=id>299990</field><field >> name=name>trailblazers</field></doc></add>", > [...] > > Am away from where I can check this, but your Solr XMl seems ill-formed. > Please take a look at example/exampledocs/mem.xml in a Solr source > directory for an example. The "name" attribute for each field needs to be > quoted, and here the quotes would need to be escaped. Please see > http://stackoverflow.com/questions/3099369/jquery-ajax-post-to-web-service > for an example of a proper XML post from jQuery.ajax > > Regards, > Gora