0
0
Elasticsearchquery~10 mins

Why Elasticsearch exists - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an Elasticsearch index named 'products'.

Elasticsearch
PUT /[1]
Drag options to blanks, or click blank then click option'
Acustomers
Busers
Cproducts
Dorders
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong index name like 'users' or 'orders'.
Forgetting to specify the index name.
2fill in blank
medium

Complete the query to search for documents where the field 'name' matches 'laptop'.

Elasticsearch
{ "query": { "match": { "[1]": "laptop" } } }
Drag options to blanks, or click blank then click option'
Acategory
Btitle
Cdescription
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using a field that does not exist like 'title' or 'category'.
Misspelling the field name.
3fill in blank
hard

Fix the error in the query to filter documents with price greater than 100.

Elasticsearch
{ "query": { "range": { "price": { "[1]": 100 } } } }
Drag options to blanks, or click blank then click option'
Agt
Blt
Clte
Dgte
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'lt' or 'lte' which filter for less than values.
Using 'gte' which includes 100, not strictly greater.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.

Elasticsearch
{word: [1] for word in words if [2](word) > 3}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
Clen
Dword.upper()
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'word' as value instead of its length.
Using 'word' instead of 'len' in the condition.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if value is greater than 0.

Elasticsearch
result = { [1]: [2] for [3], [2] in data.items() if [2] > 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'value' instead of 'v' as loop variable.
Not converting keys to uppercase.