0
0
Elasticsearchquery~10 mins

Boolean and binary types in Elasticsearch - Interactive Code Practice

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

Complete the code to define a boolean field in an Elasticsearch mapping.

Elasticsearch
{
  "mappings": {
    "properties": {
      "is_active": { "type": "[1]" }
    }
  }
}
Drag options to blanks, or click blank then click option'
Atext
Bboolean
Ckeyword
Dinteger
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'keyword' type for boolean values.
Using 'integer' type instead of boolean.
2fill in blank
medium

Complete the code to define a binary field in an Elasticsearch mapping.

Elasticsearch
{
  "mappings": {
    "properties": {
      "file_data": { "type": "[1]" }
    }
  }
}
Drag options to blanks, or click blank then click option'
Atext
Bkeyword
Cboolean
Dbinary
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'keyword' type for binary data.
Using 'boolean' type instead of binary.
3fill in blank
hard

Fix the error in the mapping to correctly define a boolean field.

Elasticsearch
{
  "mappings": {
    "properties": {
      "is_enabled": { "type": "[1]" }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aboolean
Bbool
Ctext
Dbinary
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bool' instead of 'boolean'.
Using 'text' or 'binary' for boolean fields.
4fill in blank
hard

Fill both blanks to define a binary field with doc_values disabled.

Elasticsearch
{
  "mappings": {
    "properties": {
      "image_data": {
        "type": "[1]",
        "[2]": false
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Abinary
Bdoc_values
Cstore
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'boolean' instead of 'binary' for binary data.
Using 'store' instead of 'doc_values' to disable storage.
5fill in blank
hard

Fill all three blanks to define a boolean field with a default value and doc_values enabled.

Elasticsearch
{
  "mappings": {
    "properties": {
      "is_verified": {
        "type": "[1]",
        "[2]": true,
        "[3]": true
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Abinary
Bdoc_values
Cnull_value
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'binary' instead of 'boolean' for boolean fields.
Confusing 'null_value' with 'doc_values'.