I am trying to use a dynamic template to disable analysis on a field by setting enabled: false
in its mapping.
This is the mapping I'm using:
{
"mappings": {
"dynamic": true,
"dynamic_templates": [
{
"disable_field": {
"match": "disabled-field",
"mapping": {
"enabled": false
}
}
}
]
}
}
When I index this document:
{
"disabled-field": "a string"
}
The mapping is created with disabled-field
as type text
:
{
"disabled-field-index" : {
"mappings" : {
"dynamic" : "true",
"dynamic_templates" : [
{
"disable_field" : {
"match" : "disabled-field",
"mapping" : {
"enabled" : false
}
}
}
],
"properties" : {
"disabled-field" : {
"type" : "text"
}
}
}
}
}
Shouldn't the disabled-field
have enabled: false
after indexing the document?