Complete the code to specify the HTTP method for bulk operations.
{ "[1]": { "_index": "products", "_id": "1" } }
{ "name": "Laptop", "price": 1200 }The Bulk API requires specifying the action type like index to add or update documents.
Complete the code to specify the bulk API endpoint in Elasticsearch.
POST /[1]/_bulk { "index": { "_index": "products", "_id": "2" } } { "name": "Phone", "price": 800 }
The bulk API endpoint is /_bulk which allows batch operations.
Fix the error in the bulk request by completing the missing action keyword.
{ "[1]": { "_index": "products", "_id": "3" } }
{ "name": "Tablet", "price": 600 }The create action adds a new document only if it does not exist, which is required here.
Fill both blanks to create a bulk request that updates a document and deletes another.
{ "[1]": { "_index": "products", "_id": "4" } }
{ "doc": { "price": 950 } }
{ "[2]": { "_index": "products", "_id": "5" } }The first action is update to change the price, and the second is delete to remove a document.
Fill all three blanks to build a bulk request that indexes a new document, updates another, and deletes a third.
{ "[1]": { "_index": "products", "_id": "6" } }
{ "name": "Monitor", "price": 300 }
{ "[2]": { "_index": "products", "_id": "7" } }
{ "doc": { "price": 280 } }
{ "[3]": { "_index": "products", "_id": "8" } }The first action is create to add a new document only if it doesn't exist, the second is update to modify an existing document, and the third is delete to remove a document.