Elasticsearch Bulk import.
I need to import the Products as individual items.
I have a json file that looks similar to the following:
{
\"
I was able to add the necessary headers with the following sed script:
sed -e 's/^/{ "index" : {} }\n/' -i products.json
This will add an empty index above each line in the file. An empty index is allowed as long as the index and type are specified in the URL. After that, the proper call would be
curl -s -XPOST http://localhost:9200/cp/products/_bulk --data-binary @products.json