Despairly trying to add n-gram to an index but no effect! I try dozen combination but still does not have partial word matching!
ICreateIndexResponse indexResult = await _elasticClient.CreateIndexAsync("product", p => p
.Mappings(m => m.Map<ProductDetailModel>(c => c.AutoMap()))
.Settings(setting => setting
.TokenFilters(t => t.NGram("nGram", ng => ng.MinGram(2).MaxGram(2)))
.Analyzers(an => an
.Custom("test", ca => ca
.Tokenizer("standard")
.Filters("nGram" )
)
)
)
)
);
Here is the query
{
"query": {
"match" : { "name" : "gra" }
}
}
Thanks in advance