old_indexnew_indexsource and dest fieldsold_indexnew_indexsource and dest fieldssource with a key index set to the string "old_index".Use curly braces to create a dictionary with key index and value "old_index".
dest with a key index set to the string "new_index".Similar to step 1, create a dictionary with key index and value "new_index".
reindex_request with keys source and dest set to the variables source and dest respectively.Use a dictionary with keys source and dest pointing to the previously created variables.
reindex_request JSON object.Use print(reindex_request) to show the final JSON object.
What is the main purpose of _reindex API in Elasticsearch?
_reindex_reindex API is designed to copy documents from a source index to a destination index._reindex._reindex copies data [OK]Which of the following is the correct minimal syntax to reindex data from old_index to new_index using Elasticsearch's REST API?
{
"source": {"index": "old_index"},
"dest": {"index": "new_index"}
}source and dest with nested index names.destination. { "src": { "index": "old_index" }, "dest": { "index": "new_index" } } uses wrong key src.source and dest keys exactly [OK]Given the following reindex request, what will be the result?
{
"source": { "index": "products" },
"dest": { "index": "products_new" },
"script": {
"source": "ctx._source.price = ctx._source.price * 1.1"
}
}Assuming products has documents with a price field.
price by multiplying it by 1.1 during reindexing.products are copied to products_new with updated price values increased by 10%.Identify the error in this reindex request:
{
"source": { "index": "old_index" },
"dest": { "index": "new_index" },
"query": {
"match": { "status": "active" }
}
}query must be inside the source object to filter documents.match syntax is correct, and dest index name is valid.You want to reindex data from logs_2023 to logs_archive but only include documents where level is "error" and add a new field archived set to true. Which reindex request achieves this?
query with term filter must be inside the source object to select only error level logs.script sets ctx._source.archived = true to add the new field during reindex.query inside source with term filter for level: "error" and script setting ctx._source.archived = true is correct. Placing query at top level is invalid. Using match instead of term or setting archived to false is incorrect.Pass the test and this pattern moves unknown