Is elasticsearch Querying on a field value case sensitive?

Hi,

I could see some surprising behavior from elastic search , please see below.

For one index, its returning different count with different casing. For one index, it is same. Is there some setting at index level for case sensitive querying?

GET customevent-2017.05/_search
{
  "query": {"match": {
    "EventTemplateName": "CustomEvent"
  }}
}

hits : 42172940

GET customevent-2017.05/_search
{
  "query": {"match": {
    "EventTemplateName": "customevent"
  }}
}

hits : 0

GET customevent/_search
{
  "query": {"match": {
    "EventTemplateName": "CustomEvent"
  }}
}

hits : 1044672074

GET customevent/_search
{
  "query": {"match": {
    "EventTemplateName": "customevent"
  }}
} 

hits: 1044672074

Seems I got the issue here. If field is analyzed, then the query is case insensitive. If the query is not analyzed, then it is case sensitive. Thanks.

Hi,

The "lowercase" token filter makes fields case-insensitive.
https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lowercase-tokenfilter.html

In addition, the "Standard" analyzer includes the lowercase filter, I assume that your "analyzed" field uses this.
https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-analyzer.html

Got the issue here, Analyzed string is NOT case sensitive and Not Analyzed string is Case sensitive

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