Bird
0
0

What will happen if you run this reindex request?

medium📝 Predict Output Q5 of 15
Elasticsearch - Index Management

What will happen if you run this reindex request?

{ "source": { "index": "index1" }, "dest": { "index": "index2" }, "script": { "source": "ctx._source['status'] = 'archived'" } }

AThe request fails because scripts are not allowed in reindex
BDocuments are copied without any changes
CDocuments are copied from <code>index1</code> to <code>index2</code> with <code>status</code> field set to 'archived'
DOnly documents with <code>status</code> already 'archived' are copied
Step-by-Step Solution
Solution:
  1. Step 1: Understand script usage in reindex

    The script modifies each document during reindexing by setting the status field.
  2. Step 2: Confirm effect on documents

    All documents copied will have their status field updated to 'archived'.
  3. Final Answer:

    Documents are copied from index1 to index2 with status field set to 'archived' -> Option C
  4. Quick Check:

    Reindex script modifies documents during copy [OK]
Quick Trick: Use script to modify documents during reindex [OK]
Common Mistakes:
MISTAKES
  • Thinking scripts are disallowed
  • Assuming no changes happen
  • Filtering documents by script incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes