PUT app_test
{
"settings": {
"analysis": {
"analyzer": {
"ngram_analyzer": {
"filter": ["lowercase", "asciifolding", "ngram_filter"],
"tokenizer": "standard",
"type": "custom"
}
},
"filter": {
"ngram_filter": {
"max_gram": "9",
"min_gram": "2",
"token_chars": ["letter", "digit", "punctuation", "symbol"],
"type": "ngram"
}
}
},
"max_ngram_diff": "8",
"max_shingle_diff": "8"
},
"mappings": {
"properties": {
"text1": {
"analyzer": "standard",
"fields": {
"completion": {
"type": "completion"
},
"english": {
"analyzer": "english",
"type": "text"
},
"ngram": {
"analyzer": "ngram_analyzer",
"type": "text"
}
},
"type": "text"
}
}
}
}
POST app_test/_doc
{
"text1":"the,ff"
}
POST app_test/_analyze
{
"analyzer": "ngram_analyzer",
"text":"the ff"
}
POST app_test/_search
{
"query": {
"match": {
"text1.ngram": {
"query":"eventsfooddrinks",
"minimum_should_match": "60%"
}
}
}
}