Complete the code to define a boolean field in an Elasticsearch mapping.
{
"mappings": {
"properties": {
"is_active": { "type": "[1]" }
}
}
}The boolean type is used to store true/false values in Elasticsearch mappings.
Complete the code to define a binary field in an Elasticsearch mapping.
{
"mappings": {
"properties": {
"file_data": { "type": "[1]" }
}
}
}The binary type is used to store base64-encoded binary data in Elasticsearch.
Fix the error in the mapping to correctly define a boolean field.
{
"mappings": {
"properties": {
"is_enabled": { "type": "[1]" }
}
}
}The correct type for boolean fields in Elasticsearch is boolean, not 'bool'.
Fill both blanks to define a binary field with doc_values disabled.
{
"mappings": {
"properties": {
"image_data": {
"type": "[1]",
"[2]": false
}
}
}
}The binary type stores base64 data, and doc_values can be disabled for it to save memory.
Fill all three blanks to define a boolean field with a default value and doc_values enabled.
{
"mappings": {
"properties": {
"is_verified": {
"type": "[1]",
"[2]": true,
"[3]": true
}
}
}
}The field type is boolean. doc_values enables efficient sorting and aggregations. null_value sets a default when the field is missing.