Challenge - 5 Problems
Index Mapping Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the output of this mapping query?
Given this Elasticsearch index mapping, what is the type of the field
user.age?Elasticsearch
{
"mappings": {
"properties": {
"user": {
"properties": {
"name": { "type": "text" },
"age": { "type": "integer" }
}
}
}
}
}Attempts:
2 left
💡 Hint
Look inside the nested properties under
user.✗ Incorrect
The mapping defines
user.age as an integer type, which means it stores whole numbers.🧠 Conceptual
intermediate2:00remaining
Which statement about Elasticsearch mappings is true?
Choose the correct statement about index mappings in Elasticsearch.
Attempts:
2 left
💡 Hint
Think about what controls the structure and data types in Elasticsearch.
✗ Incorrect
Mappings tell Elasticsearch how to index and store each field, including data types and analyzers.
📝 Syntax
advanced2:00remaining
Which mapping snippet is syntactically correct for a date field with a custom format?
Select the valid Elasticsearch mapping snippet that defines a
created_at field as a date with format yyyy-MM-dd HH:mm:ss.Attempts:
2 left
💡 Hint
Check the valid type name for date fields in Elasticsearch.
✗ Incorrect
The correct type for date fields is "date" and the format can be customized as shown in option A.
❓ optimization
advanced2:00remaining
Which mapping choice improves search performance for exact matches on a username?
You want to optimize search for exact username matches. Which mapping is best?
Attempts:
2 left
💡 Hint
Exact matches work best on fields that are not analyzed.
✗ Incorrect
The "keyword" type stores the whole field as is, making exact match queries fast and efficient.
🔧 Debug
expert2:00remaining
What error occurs with this mapping snippet?
This mapping snippet is used to create an index. What error will Elasticsearch raise?
Elasticsearch
{
"mappings": {
"properties": {
"price": { "type": "float" },
"price": { "type": "integer" }
}
}
}Attempts:
2 left
💡 Hint
Check if you can define the same field twice with different types.
✗ Incorrect
Elasticsearch does not allow duplicate field names with conflicting types in the same mapping, causing a MappingConflictException.