Atlas Case Insensitive Search

Is it possible to run a case-insensitive search using the Keyword analyzer?


This can be accomplished with a custom analyzer defined to use the keyword tokenizer and the lowercase token filter. The keyword analyzer is hard coded to be case-sensitive, without lowercasing.

1 Like

Thanks Erik. Will the lowercase token filter allow for searches that have mixed case terms such seARch, TesT etc?

Yes, mixed case is fine with keyword+lowercase custom analyzer. All strings will be indexed as lowercased, and then during querying they’ll be lowercased behind the scenes for matching.

Thanks Erik.

On the same topic, I am unable to find any option on the Atlas portal to define custom analyzers. Is API the only way to do add/update/delete custom analyzers?

Custom analyzers requiring defining in JSON, which can be done in the Atlas Search UI: Edit Index Definition with JSON Editor.

Thanks Erik.

I was able to create a custom analyzer and use it as well. It seems that custom analyzers when used mandates adding “allowAnalyzedField” to the query. This was not required with the standard analyzers. Is this expected behavior?