Skip to content

Template with extreme negative order (e.g. -2147483648) overrides positive order template #21622

@radu-gheorghe

Description

@radu-gheorghe

Elasticsearch version: 5.0.1

Plugins installed: []

JVM version: 1.8.0_45 but I've seen other versions, too

OS version: OSX El Capitan but I've seen it on RHEL 6, too

Description of the problem including expected versus actual behavior:
I'm expecting templates with higher order to always override those with lower order. It doesn't seem to happen if one of them has a value of -2147483648 or close to it (tried with 46 and 47) AND another has a positive value (tried here with 2). It works if the negative number is less extreme (-2000000000 for example) OR if the second template has a higher, yet still negative order (-2 for example).

Steps to reproduce:

# curl -XDELETE localhost:9200/_template/*
# curl -XDELETE localhost:9200/_all

curl -XPUT localhost:9200/_template/higher_order -d '{
    "template": "*",
    "order": 2,
    "mappings": {
      "message": {
        "properties": {
          "foo": {
            "type": "keyword"
          }
        }
      }
    }
}'

curl -XPUT localhost:9200/_template/lower_order -d '{
    "order" : -2147483648,
    "template" : "*",
    "mappings" : {
      "message" : {
        "properties" : {
          "foo" : {
            "type" : "text"
          }
        }
      }
    }
  }'

curl -XPUT localhost:9200/test
curl localhost:9200/test?pretty
#          "foo" : {
#            "type" : "text"   # <----- should be keyword
#          }

This affects Graylog users, see http://docs.graylog.org/en/2.1/pages/configuration/elasticsearch.html#custom-index-mappings

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions