Hi There:
The solution was given in the Practice Exam, just a bit confused with the custom analyzer and script query. Please advise, appreciate your helps. Thank you so much, see below Task 5 question and solutions
Task 5 Question
Create a new index on cluster1 named task5 that satisfies the following requirements:
- contains all of the documents from the
blogsindex - whenever the string UK (both capital letters) appears in the
contentfield, it gets replaced with United Kingdom
Practice Exam Given solution
PUT task5
{
"settings": {
"analysis": {
"char_filter": {
"uk_filter": {
"type": "mapping",
"mappings": [
"UK => United Kingdom"
]
}
},
"analyzer": {
"content_analyzer": {
"tokenizer": "standard",
"char_filter": ["uk_filter"]
}
}
}
},
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "content_analyzer"
}
}
}
}
POST _reindex
{
"source": {
"index": "blogs"
},
"dest": {
"index": "task5"
}
}
Why not this solution? (my own) 
POST _reindex
{
"source": {
"index": "blogs"
},
"dest": {
"index": "task5"
},
"script": {
"source": "if (ctx['content'] == 'UK') {ctx['content']=='United Kingdom'}",
"lang": "painless"
}
}