This worked and leads into another question. The file I am trying to batch import has 1.5M docs. No luck. I had to reduce it down to 250K entries before I was able to successfully able to do a batch import. Is there a limit to the number of documents that are supported?


Tim King
December 17, 2010 5:07 PM

Try adding this header argument after your curl command:

-H "Content-Type: application/json"


Chris Johnson
December 17, 2010 3:52 PM

I have an XML doc that I am parsing that results in 5M documents. I have been successful in serializing this and writing to the database but this takes an extremely long time. As a result, I am testing the _bulk_docs import but have not been successful.

Below is a snapshot of the file that I am creating to do the bulk import, but when I use it, I get the following error:

>curl -X POST -d @bulk.json
>{"error":"bad_content_type","reason":"Content-Type must be application/json"}

        "docs": [
{ "session_id":"849", "policyID":"trust-to-untrust/4", "in_srcIP":"", "in_srcPort":"49174", "in_dstIP":"", "in_dstPort":"993", "out_srcIP":"", "out_srcPort":"993", "out_dstIP":"", "out_dstPort":"38324", "protocol":"tcp" },
{ "session_id":"2127", "policyID":"trust-to-untrust/4", "in_srcIP":"", "in_srcPort":"49197", "in_dstIP":"", "in_dstPort":"993", "out_srcIP":"", "out_srcPort":"993", "out_dstIP":"", "out_dstPort":"27540", "protocol":"tcp" },
{ "session_id":"2364", "policyID":"trust-to-untrust/4", "in_srcIP":"", "in_srcPort":"49309", "in_dstIP":"", "in_dstPort":"5050", "out_srcIP":"", "out_srcPort":"5050", "out_dstIP":"", "out_dstPort":"38335", "protocol":"tcp" },