0
0
Elasticsearchquery~10 mins

Text vs keyword field types in Elasticsearch - Interactive Practice

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

Complete the code to define a keyword field in Elasticsearch mapping.

Elasticsearch
"status": { "type": "[1]" }
Drag options to blanks, or click blank then click option'
Akeyword
Btext
Cinteger
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' type when exact matching is needed.
Confusing 'keyword' with numeric types.
2fill in blank
medium

Complete the code to define a text field with English analyzer.

Elasticsearch
"description": { "type": "[1]", "analyzer": "english" }
Drag options to blanks, or click blank then click option'
Along
Bkeyword
Cboolean
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'keyword' type with an analyzer.
Choosing a numeric type for text content.
3fill in blank
hard

Fix the error in the mapping: the field should be searchable as exact value but is defined as text.

Elasticsearch
"category": { "type": "[1]" }
Drag options to blanks, or click blank then click option'
Akeyword
Binteger
Ctext
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving the field as 'text' when exact matching is required.
Using numeric types for string fields.
4fill in blank
hard

Fill both blanks to create a mapping with a text field and a keyword subfield.

Elasticsearch
"title": { "type": "[1]", "fields": { "raw": { "type": "[2]" } } }
Drag options to blanks, or click blank then click option'
Atext
Bkeyword
Cinteger
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using keyword type for the main field when full-text search is needed.
Not defining a keyword subfield for sorting or aggregations.
5fill in blank
hard

Fill all three blanks to create a mapping with a text field, a keyword subfield, and a custom analyzer.

Elasticsearch
"summary": { "type": "[1]", "analyzer": "[2]", "fields": { "keyword": { "type": "[3]" } } }
Drag options to blanks, or click blank then click option'
Akeyword
Btext
Dstandard
Attempts:
3 left
💡 Hint
Common Mistakes
Using keyword type with an analyzer (not supported).
Omitting the keyword subfield for exact matches.