0
0
Elasticsearchquery~20 mins

Enrich processor in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Enrich Processor Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this enrich processor simulation?
Given the enrich processor configuration below, what will be the value of the field user_info.name after enrichment?
Elasticsearch
{
  "enrich": {
    "policy_name": "user_policy",
    "field": "user_id",
    "target_field": "user_info"
  }
}

// Assume the enrich index contains a document with user_id=42 and name="Alice"
A"Alice"
B"user_id"
Cnull
D"user_info"
Attempts:
2 left
💡 Hint
The enrich processor copies matching fields from the enrich index document to the target field.
🧠 Conceptual
intermediate
1:30remaining
Which field does the enrich processor use to match documents?
In an enrich processor configuration, which field is used to find matching documents in the enrich index?
AThe <code>field</code> specified in the enrich processor
BThe <code>target_field</code> specified in the enrich processor
CThe <code>policy_name</code> specified in the enrich processor
DThe <code>index</code> name of the enrich index
Attempts:
2 left
💡 Hint
Look for the field that identifies the key to match on.
🔧 Debug
advanced
2:30remaining
Why does this enrich processor fail with a missing field error?
This enrich processor configuration causes an error when the field to enrich on is missing in some documents. What is the cause?
Elasticsearch
{
  "enrich": {
    "policy_name": "city_policy",
    "field": "city_id",
    "target_field": "city_info"
  }
}

// Some documents do not have 'city_id' field
AThe enrich processor cannot handle null values in the enrich index.
BThe <code>target_field</code> is incorrectly named and causes the error.
CThe enrich policy <code>city_policy</code> is not created, causing the error.
DThe enrich processor requires the <code>field</code> to exist in every document; missing fields cause failure.
Attempts:
2 left
💡 Hint
Check what happens if the field used for matching is missing in the document.
📝 Syntax
advanced
1:30remaining
Which enrich processor configuration is syntactically correct?
Choose the syntactically correct enrich processor configuration snippet.
A{ "enrich": { "policy_name": "user_policy", "field": "user_id" "target_field": "user_info" } }
B{ "enrich": { "policy_name": "user_policy", "field": "user_id", "target_field": "user_info" } }
C{ "enrich": { "policy_name": "user_policy", "field": "user_id", "target_field" } }
D{ "enrich": { "policy_name": "user_policy", "field": , "target_field": "user_info" } }
Attempts:
2 left
💡 Hint
Look for missing commas or missing values.
🚀 Application
expert
3:00remaining
How many fields will be added to the document after enrichment?
An enrich policy indexes documents with fields city_id, name, and population. The enrich processor is configured with field": "city_id" and target_field": "city_info". After enrichment, how many new fields will be added under city_info in the original document?
A3
B1
C2
D0
Attempts:
2 left
💡 Hint
The enrich processor copies all fields except the matching key into the target field.