In our service we are trying to port a customization of the "nysiis" phonetic algorithm to Elasticsearch.
Our algorithm performs this name transformation:
given a list of "Surnames" and "Firstnames", such as "[Smith]" and "[John]", takes the "nysiis" phonetic encoder on the first surname, and concatenates it to the lowercase first initial of the first firstname.
Hence:
nysiis(Surnames[0]) + lower(Firstnames[0][0])
So the result with "John Smith" would be "SNATHj"
I know ES supports the nyyis token filter https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-phonetic-token-filter.html
but I wonder what is the best way to implement a custom analyzer that automatically perform the above transformation.
Note: I guess, if needed, we can already provide ES with a simple structure:
{"surname": "Smith", "initial_first_name": "j"}