Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASE_INSENSITIVE not working in ElasticSearch > 1.7 #17437

Closed
Filirom1 opened this issue Mar 31, 2016 · 2 comments
Closed

CASE_INSENSITIVE not working in ElasticSearch > 1.7 #17437

Filirom1 opened this issue Mar 31, 2016 · 2 comments

Comments

@Filirom1
Copy link

Elasticsearch version: 2.2 and 2.3 (it was working in ES 1.7)

JVM version: openjdk version "1.8.0_77"

OS version: centos 7.2

Description of the problem including expected versus actual behavior:CASE_INSENSITIVE flags in aggregation is not working

Steps to reproduce:

curl -XPOST -d '{"mappings":{"type":{"properties":{"name":{"type":"string", "index": "not_analyzed"}}}}}' localhost:9200/toto

curl -XPOST -d '{"name": "g1"}' localhost:9200/toto/type/1
curl -XPOST -d '{"name": "g2"}' localhost:9200/toto/type/2
curl -XPOST -d '{"name": "G3"}' localhost:9200/toto/type/3

curl  -XPOST localhost:9200/toto/_search?pretty -d '{
"size": 0,
  "aggs": {
    "2": {
      "terms": {
        "field": "name",
        "include": {
          "pattern": "g[0-9]",
          "flags": "CASE_INSENSITIVE"
        }
      }
    }
  }
}'
{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 4,
    "max_score" : 0.0,
    "hits" : [ ]
  },
  "aggregations" : {
    "2" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [ {
        "key" : "g1",
        "doc_count" : 1
      }, {
        "key" : "g2",
        "doc_count" : 1
      } ]
    }
  }
}

G3 is not displayed

@jimczi
Copy link
Contributor

jimczi commented Mar 31, 2016

Thanks @Filirom1. This is documented in the breaking 2.0 aggregation changes here:
https://www.elastic.co/guide/en/elasticsearch/reference/2.3/breaking_20_aggregation_changes.html#_including_excluding_terms
The flags parameter is no longer supported but we have some leniency in the aggregation parsers.

@tom10271
Copy link

tom10271 commented May 2, 2019

The last comment is not very clear. Originally we set "CANON_EQ|CASE_INSENSITIVE" as flag, and it is no longer supported now. Do these handled already by aggregation parser? If not what should I do to keep the result returned consistent?

Thank you for answering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants