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

Index Templates API - Set Source #1860

Closed
nhuray opened this issue Apr 15, 2012 · 0 comments
Closed

Index Templates API - Set Source #1860

nhuray opened this issue Apr 15, 2012 · 0 comments

Comments

@nhuray
Copy link
Contributor

nhuray commented Apr 15, 2012

This issue refers to this discussion

Context :

There's no way with the Java client API to create a template and set the source like that :

PutIndexTemplateResponse response = client.admin().indices()
   .preparePutTemplate("twitter_template").
   .setSource(sourceTemplate)
   .execute()
   .actionGet();

instead to set settings, mappings ... like that :

PutIndexTemplateResponse response = client.admin().indices()
   .preparePutTemplate("twitter_template")
   .setTemplate("twitter*")
   .addMapping("tweet", sourceMapping)
   .setSettings(sourceSettings)
   .execute()
   .actionGet();

Solution :

We have to move the parsing logic from RestPutIndexTemplateAction.handleRequest() method to the PutIndexTemplateRequest.setSource() method

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

1 participant