Elasticsearch: Display ES version as part of index.version in index settings

Created on 19 Apr 2016  路  3Comments  路  Source: elastic/elasticsearch

Describe the feature:

Currently, we display index.version.created in index settings as Lucene version string, eg. 1070199.

For most end users out/admins there, this is often not intuitive unless they know to check the mapping here.

    "settings" : {
      "index" : {
        "creation_date" : "1460617724303",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "version" : {
          "created" : "1070199"
        }
      }
    }

The index.version.created has become more useful as we make changes to the product. For example, with the fielddata to doc_values change, it is helpful to look at the index created version to determine if the index was created on 1.7 (which defaults to fielddata). Looking at the mappings api output will not provide this information anymore on 2.x because all fields default to doc values (so if a mapped field has no doc_values setting showing from the mappings api, is it using doc values on 2.x? Or really using fielddata because the index was created on 1.x). A quick way to check will be to look at the index.version.created field. In 5.0, I believe we also have some internal data-structures that do not get upgraded as part of the regular merge process (or upgrade api) and requires creating the index on 5.0. So having the index.version.created be a string that is intuitive to the end user will be helpful.

For example, can we show it as V_1_7_1 (1070199) instead of just 1070199? Or add another field under index.version showing the corresponding V_1_7_1 (if changing the format of index.version.created will break backwards compatibility).

:CorFeatureStats :CorInfrREST API >enhancement discuss

Most helpful comment

Human readable format already does that, isn't ?

curl -XGET http://localhost:9200/{index_name}/_settings/?pretty

"settings": {
    "index": {
      "creation_date": "1461220754753",
      "number_of_shards": "5",
      "number_of_replicas": "1",
      "uuid": "drUys0-HSdGSyw5iuJeOzg",
      "version": {
        "created": "5000099"
      }
    }
  }

curl -XGET http://localhost:9200/{index_name}/_settings/?pretty&human

"settings": {
    "index": {
      "creation_date_string": "2016-04-21T06:39:14.753Z",
      "number_of_shards": "5",
      "creation_date": "1461220754753",
      "number_of_replicas": "1",
      "uuid": "drUys0-HSdGSyw5iuJeOzg",
      "version": {
        "created_string": "5.0.0",
        "created": "5000099"
      }
    }
  }

All 3 comments

Human readable format already does that, isn't ?

curl -XGET http://localhost:9200/{index_name}/_settings/?pretty

"settings": {
    "index": {
      "creation_date": "1461220754753",
      "number_of_shards": "5",
      "number_of_replicas": "1",
      "uuid": "drUys0-HSdGSyw5iuJeOzg",
      "version": {
        "created": "5000099"
      }
    }
  }

curl -XGET http://localhost:9200/{index_name}/_settings/?pretty&human

"settings": {
    "index": {
      "creation_date_string": "2016-04-21T06:39:14.753Z",
      "number_of_shards": "5",
      "creation_date": "1461220754753",
      "number_of_replicas": "1",
      "uuid": "drUys0-HSdGSyw5iuJeOzg",
      "version": {
        "created_string": "5.0.0",
        "created": "5000099"
      }
    }
  }

Human readable format already does that, isn't ?

Yes, it does. Thank you.

Nice! Didn't realize we already do this via the human parameter, would be nice for it to be the default, but this is certainly sufficient. thx!

Was this page helpful?
0 / 5 - 0 ratings