Bird
0
0

Examine this reindex request and identify the error:

medium📝 Debug Q6 of 15
Elasticsearch - Index Management

Examine this reindex request and identify the error:

{ "source": { "index": "source_index" }, "dest": { "index": "dest_index" }, "script": { "source": "ctx._source.status = archived" } }

AThe script field should be outside the reindex body
BThe source index name is invalid
CThe destination index is missing
DThe script is missing quotes around the string 'archived'
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the script

    The script assigns ctx._source.status = archived. Since archived is a string, it must be quoted.
  2. Step 2: Check other parts

    Source and destination indexes are correctly specified. The script field is correctly placed.
  3. Final Answer:

    Missing quotes around 'archived' -> Option D
  4. Quick Check:

    Strings in painless scripts require quotes [OK]
Quick Trick: Strings in scripts must be quoted [OK]
Common Mistakes:
MISTAKES
  • Forgetting quotes around string literals in scripts
  • Misplacing script field outside reindex body
  • Incorrect index names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes