I am working on a problem of identifying email patterns if you are given an email address. I have a dataset of surnames. If I pass an email address to elasticsearch it should return matching surnames inside that email address. In other words I am looking for a method to find out all the results where results are substring of query string. For example, if my query string is ajohnson then elasticsearch should return me johnson from surname dataset.
You can create your Custom Analyzer with NGram Tokenizer and use it as search_analyzer
. As a result your query string can be split into n-grams and each n-gram will be searched in a surname.