Lowercase normalizer not working

HI, m trying to do exact search , with case insensitve.
I am able to exact search using "keyword" ,but even after adding normalizer. It does not work with case insenisitve.i have to give exact term to search.

.Match(m => m.Field(f => f.fieldNmae.Suffix("keyword")).Query(filterText)));

and found few document saying to add normalizer while creating index.
so i deleted the index and recreated with normalizer like below

.Settings(s => s.Analysis(a => a.Normalizers(n => n.Custom("my_lowercase", f => f.Filters("lowercase")))))
                    .Map<ObjectType>(l => l.AutoMap()
                        .Properties(p => p.Keyword(k => k.Name(n => n.fieldName).Normalizer("my_lowercase")))

Can anyone tell me , what mistake i am making here ?

Thanks in advance

What is the mapping for the field in Elasticsearch?

is this what you are asking ?

                                .Match(m => m.Field(f => f.fieldName.Suffix("keyword")).Query(filterText)));

No. Retrieve the mapping for the field using the get mapping API.


normalizer showing null even though have applied it

.Map(m => m.DynamicTemplates(dt => dt.DynamicTemplate("string_to_keyword", t => t
                                .Mapping(map => map.Text(tx => tx.Fields(f => f.Keyword(k => k.Name("keyword").Normalizer("lowercase"))))))))

using this one worked for me

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.