: I am trying to post JSON Data to Solr using XHR / JQuery and it doesn't seem

You are not POSTing any JSON data.  In this method...

:         var jqxhr = $.post(url, { "id" : "978-0545139700",
:             "cat" : "book",
:             "name" : "Harry Potter and the Deathly Hallows",
:             "author" : "J K Rowling",
:             "price" : "13.65",
:             "pages_i" : "787"            
:         },

...what you passing the post() method is an anon map containing keys 
"id", "cat", "name", etc... which jquery then treats as form data sent 
using application/x-www-form-urlencoded

http://api.jquery.com/jQuery.ajax/#sending-data-to-server

If you want to POST json data you need to specify the JSON contentType 
(and i believe: serialize the map to a single string yourself ... there 
are lots of examples if you google "POST json data with jquery")

: Here is the message on the console. 

You can see from logs that the individual key=val pairs in your map where 
sent to solr as request params...

: *INFO: [collection1] webapp=/solr path=/update
: 
params={id=978-0545139700&author=J+K+Rowling&cat=book&price=13.65&pages_i=787&commit=true&name=Harry+Potter+and+the+Deathly+Hallows}
: {commit=} 0 29


-Hoss

Reply via email to