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

Allow specify dynamic templates in bulk request #71518

Merged
merged 4 commits into from
Apr 10, 2021

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Apr 9, 2021

Backport of #69948 to 7.x

This change allows users to specify dynamic templates in a bulk request.

PUT myindex
{
  "mappings": {
    "dynamic_templates": [{
      "time_histograms": {
        "mapping": {
          "type": "histogram",
          "meta": {
            "unit": "s"
          }
        }
      }
    }]
  }
}
// Tells ES to use the dynamic template named `time_histograms` for field `response_times`
// in the index request
POST myindex/_bulk
{ "index": { "dynamic_templates": { "response_times": "time_histograms" } } }
{ "@timestamp": "2020-08-12", "response_times": { "values": [1, 10], "counts": [5, 1] }}

Closes #61939

dnhatn added 3 commits April 8, 2021 21:45
This change allows users to specify dynamic templates in a bulk request.

```
PUT myindex
{
  "mappings": {
    "dynamic_templates": [{
      "time_histograms": {
        "mapping": {
          "type": "histogram",
          "meta": {
            "unit": "s"
          }
        }
      }
    }]
  }
}
```

```
POST myindex/_bulk
{ "index": { "dynamic_templates": { "response_times": "time_histograms" } } }
{ "@timestamp": "2020-08-12", "response_times": { "values": [1, 10], "counts": [5, 1] }}
```

Closes elastic#61939
@dnhatn dnhatn added the backport label Apr 9, 2021
@dnhatn dnhatn merged commit 5913b79 into elastic:7.x Apr 10, 2021
@dnhatn dnhatn deleted the 7x-dynamic-template branch April 10, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant