How to reference the custom analyzer present in settings component template in mappings component template?
I have created a component template for settings as shown below but creating a mappings component template that references customer analyzer defined in settings component template failing with error
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: analyzer [my_custom_analyzer] has not been configured in mappings"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: analyzer [my_custom_analyzer] has not been configured in mappings",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "analyzer [my_custom_analyzer] has not been configured in mappings"
}
},
"status": 400
}
Why it is not working? Any idea?
btw i am using ES version 7.17.20
PUT _component_template/settings_template
{
"template": {
"settings": {
"analysis": {
"filter": {
"my_custom_filter": {
"type": "synonym",
"synonyms": [
"quick,fast",
"jumps,leaps"
]
}
},
"analyzer": {
"my_custom_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"my_custom_filter"
]
}
}
}
}
}
}
PUT /_component_template/mappings_template
{
"template": {
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "my_custom_analyzer"
}
}
}
}
}