- Java Transport Client (deprecated): other versions:
- Preface
- Maven Repository
- Dealing with JAR dependency conflicts
- Embedding jar with dependencies
- Deploying in JBoss EAP6 module
- Client
- Document APIs
- Search API
- Count API
- Aggregations
- Percolate API
- Query DSL
- Indexed Scripts API
- Java API Administration
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Indexed Scripts API
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Indexed Scripts API
editThe 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.
Was this helpful?
Thank you for your feedback.