Inserting Elasticsearch Documents in Bulk
We need one more big feature from the esclu command-line tool, and thatâs to allow us to bulk-upload documents. Recall that in âProcessing Data Files Sequentiallyâ, we developed an LDJ data file containing interleaved commands and documents for Elasticsearchâs bulk API.
Hereâs a truncated sample to refresh your memory:
â | {â"index"â:{â"_id"â:â"pg11"â}} |
â | {â"id"â:11,â"title"â:â"Alice's Adventures in Wonderland"â,â"authors"â:...} |
â | {â"index"â:{â"_id"â:â"pg132"â}} |
â | {â"id"â:132,â"title"â:â"The Art of War"â,â"authors"â:...} |
Open your index.js file and insert this new command, again before the program.parse line.
â |
Get Node.js 8 the Right Way now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.