A case-insensitive search
When we conduct a search, the search has to be case insensitive. This means that even if the user searches with capital letters in keywords, his/her search should avoid the casing of the characters and match keywords with any case. In short, the following should happen while indexing and searching:
[ "ElasticSearch" , "elasticSearch" ] => "elasticsearch"
To enable a case-insensitive search, we need to design our analyzers accordingly. Once the analyzer is made, we need to simply apply it to the fields in the mapping. Let's see how we can achieve this:
First, we need to create the analyzer:
curl -X PUT "http://localhost:9200/news" -d '{ "analysis": { "analyzer": { "lowercase": { "type": "custom", "tokenizer": "standard", "filter": [ "lowercase" ] } } } }'
Then, we need to apply the analyzer to the required field:
curl -X PUT "http://localhost:9200/news/public/_mapping" -d '{ "public": { "properties...