0
0
Elasticsearchquery~10 mins

Bulk API for batch operations in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the HTTP method for bulk operations.

Elasticsearch
{ "[1]": { "_index": "products", "_id": "1" } }
{ "name": "Laptop", "price": 1200 }
Drag options to blanks, or click blank then click option'
Aupdate
Bget
Csearch
Dindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get' instead of 'index' causes errors because 'get' is for retrieving documents.
Using 'search' is invalid in bulk operations.
2fill in blank
medium

Complete the code to specify the bulk API endpoint in Elasticsearch.

Elasticsearch
POST /[1]/_bulk
{ "index": { "_index": "products", "_id": "2" } }
{ "name": "Phone", "price": 800 }
Drag options to blanks, or click blank then click option'
A_search
B_bulk
C_update
D_delete
Attempts:
3 left
💡 Hint
Common Mistakes
Using '_search' endpoint instead of '_bulk' will not perform batch operations.
Using '_update' or '_delete' endpoints individually instead of bulk.
3fill in blank
hard

Fix the error in the bulk request by completing the missing action keyword.

Elasticsearch
{ "[1]": { "_index": "products", "_id": "3" } }
{ "name": "Tablet", "price": 600 }
Drag options to blanks, or click blank then click option'
Adelete
Bindex
Ccreate
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'index' overwrites documents instead of creating new ones.
Using 'delete' or 'update' is incorrect for adding new documents.
4fill in blank
hard

Fill both blanks to create a bulk request that updates a document and deletes another.

Elasticsearch
{ "[1]": { "_index": "products", "_id": "4" } }
{ "doc": { "price": 950 } }
{ "[2]": { "_index": "products", "_id": "5" } }
Drag options to blanks, or click blank then click option'
Aupdate
Bindex
Cdelete
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'index' instead of 'update' will overwrite the whole document.
Using 'create' instead of 'delete' will cause errors.
5fill in blank
hard

Fill all three blanks to build a bulk request that indexes a new document, updates another, and deletes a third.

Elasticsearch
{ "[1]": { "_index": "products", "_id": "6" } }
{ "name": "Monitor", "price": 300 }
{ "[2]": { "_index": "products", "_id": "7" } }
{ "doc": { "price": 280 } }
{ "[3]": { "_index": "products", "_id": "8" } }
Drag options to blanks, or click blank then click option'
Aindex
Bupdate
Cdelete
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'index' instead of 'create' may overwrite documents.
Mixing up 'update' and 'delete' actions causes errors.