0
0
Elasticsearchquery~20 mins

Why indexes organize data in Elasticsearch - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elasticsearch Index 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 Elasticsearch query?

Given an Elasticsearch index named products with documents containing fields name and price, what will this query return?

{
  "query": {
    "range": {
      "price": {
        "gte": 100,
        "lte": 200
      }
    }
  }
}
AAll documents regardless of price
BDocuments with price less than 100
CDocuments with price greater than 200
DDocuments with price between 100 and 200 inclusive
Attempts:
2 left
💡 Hint

Look at the range query and the meaning of gte and lte.

🧠 Conceptual
intermediate
1:30remaining
Why does Elasticsearch use indexes to organize data?

Choose the best explanation for why Elasticsearch organizes data into indexes.

ATo prevent any data from being deleted accidentally
BTo store data in a single large file for easy backup
CTo speed up search by allowing quick lookups on specific fields
DTo make data unreadable for security reasons
Attempts:
2 left
💡 Hint

Think about how indexes help find data fast.

🔧 Debug
advanced
2:00remaining
What error does this Elasticsearch mapping cause?

Given this mapping snippet, what error will Elasticsearch raise?

{
  "mappings": {
    "properties": {
      "price": {
        "type": "text"
      }
    }
  }
}

Assuming price should be a number.

ASearch on price range queries will fail because price is text, not numeric
BElasticsearch will accept the mapping without error
CElasticsearch will throw a syntax error on mapping creation
DDocuments with price field will be rejected on indexing
Attempts:
2 left
💡 Hint

Consider the data type mismatch impact on queries.

📝 Syntax
advanced
1:30remaining
Which option correctly creates an index with a keyword field?

Choose the correct JSON to create an Elasticsearch index with a category field of type keyword.

A{ "mappings": { "properties": { "category": { "type": "keyword" } } } }
B{ "mappings": { "properties": { "category": "keyword" } } }
C{ "mappings": { "fields": { "category": { "type": "keyword" } } } }
D{ "mapping": { "category": { "type": "keyword" } } }
Attempts:
2 left
💡 Hint

Check the correct key names for mappings and properties.

🚀 Application
expert
2:30remaining
How many shards will an index have after this creation command?

You create an Elasticsearch index with this command:

PUT /my_index
{
  "settings": {
    "number_of_shards": 3,
    "number_of_replicas": 2
  }
}

How many primary shards and total shards will this index have?

A5 primary shards and 10 total shards
B3 primary shards and 9 total shards
C3 primary shards and 6 total shards
D1 primary shard and 3 total shards
Attempts:
2 left
💡 Hint

Total shards = primary shards + (primary shards × replicas).