0
0
Elasticsearchquery~20 mins

Deleting and closing indexes in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elasticsearch Index Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of closing an index?
You run the following command to close an index named my_index. What is the expected response status in the output?
Elasticsearch
POST /my_index/_close
A{"acknowledged":true}
B{"closed":true}
C{"status":"closed"}
D{"result":"closed"}
Attempts:
2 left
💡 Hint
Closing an index returns an acknowledgement from Elasticsearch.
Predict Output
intermediate
2:00remaining
What happens when deleting a non-existing index?
You try to delete an index named unknown_index that does not exist. What is the typical response status?
Elasticsearch
DELETE /unknown_index
A{"acknowledged":true}
B{"error":{"type":"index_not_found_exception"}}
C{"result":"not_found"}
D{"status":"deleted"}
Attempts:
2 left
💡 Hint
Elasticsearch returns an error if the index does not exist when deleting.
🧠 Conceptual
advanced
2:00remaining
Which statement about closing indexes is true?
Select the correct statement about closing an Elasticsearch index.
AClosed indexes remain writable but are hidden from searches.
BClosing an index frees up disk space by deleting all data.
CClosing an index automatically deletes its mappings.
DA closed index cannot be searched until it is reopened.
Attempts:
2 left
💡 Hint
Think about what closing means for index accessibility.
Predict Output
advanced
2:00remaining
What is the output after reopening a closed index?
You closed an index logs_2023 and then reopened it using POST /logs_2023/_open. What is the expected output?
Elasticsearch
POST /logs_2023/_open
A{"acknowledged":true}
B{"opened":true}
C{"result":"opened"}
D{"status":"open"}
Attempts:
2 left
💡 Hint
Opening an index returns an acknowledgement similar to closing.
Predict Output
expert
2:00remaining
What error occurs when deleting a closed index with aliases?
You have a closed index archive_2022 with an alias archive. You try to delete it using DELETE /archive_2022. What error will Elasticsearch return?
Elasticsearch
DELETE /archive_2022
A{"error":{"type":"index_closed_exception"}}
B{"acknowledged":true}
C{"error":{"type":"illegal_argument_exception","reason":"Cannot delete index with aliases"}}
D{"error":{"type":"alias_not_found_exception"}}
Attempts:
2 left
💡 Hint
Deleting an index with aliases is restricted.