Bird
0
0

Given the following reindex request, what will be the result?

medium📝 Predict Output Q13 of 15
Elasticsearch - Index Management

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.

AOnly documents with price > 1.1 are copied
BDocuments copied without any price change
CReindex fails due to script syntax error
DAll documents copied with price increased by 10%
Step-by-Step Solution
Solution:
  1. Step 1: Understand the script in reindex

    The script modifies each document's price by multiplying it by 1.1 during reindexing.
  2. Step 2: Effect on documents

    All documents from products are copied to products_new with updated price values increased by 10%.
  3. Final Answer:

    All documents copied with price increased by 10% -> Option D
  4. Quick Check:

    Script modifies price during reindex [OK]
Quick Trick: Scripts can modify fields during reindexing [OK]
Common Mistakes:
MISTAKES
  • Assuming script filters documents instead of modifying
  • Thinking script causes syntax error
  • Believing price remains unchanged

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes