Complete the code to define an object type field named 'user' in the mapping.
{
"mappings": {
"properties": {
"user": {
"type": "[1]"
}
}
}
}The 'object' type is used to define a JSON object field in Elasticsearch mapping.
Complete the code to define a nested type field named 'comments' in the mapping.
{
"mappings": {
"properties": {
"comments": {
"type": "[1]"
}
}
}
}The 'nested' type allows arrays of objects to be queried independently in Elasticsearch.
Fix the error in the mapping by completing the type for the 'address' field.
{
"mappings": {
"properties": {
"address": {
"type": "[1]"
}
}
}
}The 'address' field is a JSON object, so it should be of type 'object' to hold subfields.
Fill both blanks to define a nested field 'orders' with a subfield 'date' of type 'date'.
{
"mappings": {
"properties": {
"orders": {
"type": "[1]",
"properties": {
"date": {
"type": "[2]"
}
}
}
}
}
}The 'orders' field is nested, and its 'date' subfield should be of type 'date' for date values.
Fill all three blanks to define an object field 'profile' with a nested field 'activities' having a 'type' subfield of keyword type.
{
"mappings": {
"properties": {
"profile": {
"type": "[1]",
"properties": {
"activities": {
"type": "[2]",
"properties": {
"type": {
"type": "[3]"
}
}
}
}
}
}
}
}'profile' is an object field, 'activities' is nested, and its 'type' subfield is keyword for exact matching.