Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Incorrect sample payload for index templates documentation #495

Open
hexbioc opened this issue Jun 14, 2021 · 0 comments
Open

Incorrect sample payload for index templates documentation #495

hexbioc opened this issue Jun 14, 2021 · 0 comments

Comments

@hexbioc
Copy link

hexbioc commented Jun 14, 2021

I use v7.7.0 with AWS Elasticsearch Service.

The documentation for index templates suggests the following payload structure for creating an index template:

PUT _template/sample-index-template
{
  "index_patterns": ["sample-index-*"],
  "template": {
    "settings": {
      "index.default_pipeline": "sample_pipeline"
    }
  }
}

Above however does not seem to respect fields present inside the template key. Response for GET _template/sample-index-template:

{
  "sample-index-template" : {
    "order" : 0,
    "index_patterns" : [
      "sample-index-*"
    ],
    "settings" : { },
    "mappings" : { },
    "aliases" : { }
  }
}

In practice, the right payload seems to be as below:

PUT _template/sample-index-template
{
  "index_patterns": ["sample-index-*"],
  "settings": {
    "index.default_pipeline": "sample_pipeline"
  }
}

Notice the omission of the parent template key in the payload. This works as required, with the response for GET _template/sample-index-template as:

{
  "sample-index-template" : {
    "order" : 0,
    "index_patterns" : [
      "sample-index-*"
    ],
    "settings" : {
      "index" : {
        "default_pipeline" : "sample_pipeline"
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

Should the documentation be updated? Or is this a bug in implementation?

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

No branches or pull requests

1 participant