Club char_filter for a regex pattern and synonyms in the same query

I have an index that has candidate resumes. Resume has 2 fields: a) name b) resume
Name has name of candidate and resume has a blob of text like "address:""chicago.st", "skill":"python", "email":"myemail@ymail.com".

I want to create a mapping such that:
a) a search ob python3 also writtens python (synonyms)
b) apply char_filter to convert . to dot (but I want to apply a regex in the sense the . should convert to dot only if its an email - has @ in it. there is . in the address, that should not be converted to dot.

I have my index settings to accomplish both criteria but I am not sure how to add regex to this so the @ condition is met.

PUT my-index-synonyms-1-modify-1
{
"settings": {
"index": {
"analysis": {
"char_filter": {
"dot_char_filter": {
"type": "pattern_replace",
"pattern": "\.",
"replacement": "dot"
}
},
"analyzer": {
"my_analyzer": {
"type": "custom",
"tokenizer": "standard",
"char_filter": ["dot_char_filter"],
"filter": ["lowercase", "my_filter"]
}
},
"filter": {
"my_filter": {
"type": "synonym",
"synonyms": ["java, java2, java3"],
"updateable": true
}
}
}
}
},
"mappings": {
"properties": {
"resume": {
"type": "text",
"analyzer": "standard",
"search_analyzer": "my_analyzer"
}
}
}
}

Can someone help me please?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.