Complete the code to enable dynamic mapping in Elasticsearch index creation.
{
"mappings": {
"dynamic": [1]
}
}"true" instead of boolean true.true with invalid "enabled".Setting dynamic to true allows Elasticsearch to dynamically add new fields.
Complete the explicit mapping to define a text field with keyword subfield.
{
"properties": {
"title": {
"type": [1],
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}The title field is usually text type to allow full-text search, with a keyword subfield for exact matches.
Fix the error in the mapping to disable dynamic mapping.
{
"mappings": {
"dynamic": [1]
}
}"false" instead of boolean false."disabled" which is not a valid value.Setting dynamic to false disables adding new fields dynamically.
Fill both blanks to define an explicit mapping for a date field with a custom format.
{
"properties": {
"created_at": {
"type": [1],
"format": [2]
}
}
}The created_at field is a date type with a custom format string to parse multiple date formats.
Fill all three blanks to create a mapping with dynamic disabled, and explicit properties for name and age.
{
"dynamic": [1],
"properties": {
"name": {
"type": [2]
},
"age": {
"type": [3]
}
}
}"false" instead of boolean false.Dynamic mapping is disabled with false. The name field is text for full-text search, and age is integer for numbers.