| 123456789101112131415161718192021222324252627282930313233343536 | [[indexed-scripts]]== Indexed Scripts APIThe indexed script API allows one to interact with scripts and templatesstored in an elasticsearch index. It can be used to create, update, get, and delete indexed scripts and templates.[source,java]--------------------------------------------------PutIndexedScriptResponse = client.preparePutIndexedScript()			 .setScriptLang("groovy")					 .setId("script1") 			 .setSource("_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.=== Script LanguageThe API allows one to set the language of the indexed script being interacted with. If one is not provided the default scripting languagewill be used.
 |