You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Indexed Scripts APIedit
The indexed script API allows one to interact with scripts and templates stored in an elasticsearch index. It can be used to create, update, get, and delete indexed scripts and templates.
PutIndexedScriptResponse = client.preparePutIndexedScript() .setScriptLang("groovy") .setId("script1") .setSource("script", "_score * doc['my_numeric_field'].value") .execute() .actionGet(); GetIndexedScriptResponse = client.prepareGetIndexedScript() .setScriptLang("groovy") .setId("script1") .execute() .actionGet(); DeleteIndexedScriptResponse = client.prepareDeleteIndexedScript() .setScriptLang("groovy") .setId("script1") .execute() .actionGet();
To store templates simply use "mustache" for the scriptLang.