-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Replaces indexed script java api docs with stored script api docs
Closes #28144
- Loading branch information
Showing
4 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[[stored-scripts]] | ||
==== Stored Scripts API | ||
|
||
The stored script API allows one to interact with scripts and templates | ||
stored in Elasticsearch. It can be used to create, update, get, | ||
and delete stored scripts and templates. | ||
|
||
[source,java] | ||
-------------------------------------------------- | ||
PutStoredScriptResponse response = client.admin().cluster().preparePutStoredScript() | ||
.setId("script1") | ||
.setContent(new BytesArray("{\"script\": {\"lang\": \"painless\", \"source\": \"_score * doc['my_numeric_field'].value\"} }"), XContentType.JSON) | ||
.get(); | ||
GetStoredScriptResponse response = client().admin().cluster().prepareGetStoredScript() | ||
.setId("script1") | ||
.get(); | ||
DeleteStoredScriptResponse response = client().admin().cluster().prepareDeleteStoredScript() | ||
.setId("script1") | ||
.get(); | ||
-------------------------------------------------- | ||
|
||
To store templates simply use "mustache" for the scriptLang. | ||
|
||
===== Script Language | ||
|
||
The put stored script API allows one to set the language of the stored script. | ||
If one is not provided the default scripting language will be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.