Found it. Answer lies in the shingle filter. This mapping made it work
{
"settings": {
"analysis": {
"filter": {
"nGram_filter": {
"type": "shingle",
"max_shingle_size": 3,
"min_shingle_size": 3,
output_unigrams:false
}
},
"analyzer": {
"nGram_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding",
"nGram_filter"
]
},
"whitespace_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding"
]
}
}
}
}
}
Here key attributes are type->shingle and min/max shingle sizes.