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

Scripting: Allow to run scripts/templates stored in .scripts index #5484

Closed
kimchy opened this issue Mar 21, 2014 · 3 comments
Closed

Scripting: Allow to run scripts/templates stored in .scripts index #5484

kimchy opened this issue Mar 21, 2014 · 3 comments

Comments

@kimchy
Copy link
Member

kimchy commented Mar 21, 2014

This will be handy if search templates for example are stored in .scripts/templates index or something of the like. This can allow for recursive execution of templates, as well as "user defined queries" more easily, since changing the query/search request is just a matter of updating the query.

This will also allow to more easily disable dynamic scripts, and just allow loading them form FS or another index, with the other index allowing to easily change existing scripts.

@kimchy
Copy link
Member Author

kimchy commented Mar 24, 2014

Thought a bit more about it, it might make sense to expose the CRUD operations on a script through dedicated APIs (that will still result in storing the scripts as a document in .scripts index). This will allow to better control the structure of it through a more structured API, and will allow to issue an internal command to nodes to clear caches of a script(s) if a script was updated.

@GaelTadh GaelTadh self-assigned this Apr 25, 2014
@kevinkluge kevinkluge added v1.3.0 and removed v1.2.0 labels May 15, 2014
GaelTadh added a commit to GaelTadh/elasticsearch that referenced this issue Jul 1, 2014
Scripts can now be indexed like templates.
Anything that accepted a "script" argument now also supports an "id" or "file" argument.
For backwards compatiblity files referenced from the "script" argument are supported.
Indexed scripts now have CRUD endpoints under /_search/scripts/{lang}/{id} similar to templates.
Added a test for on disk scripts that was missing.

See elastic#5484 elastic#5921
@s1monw s1monw added v1.4.0 and removed v1.3.0 labels Jul 14, 2014
GaelTadh added a commit to GaelTadh/elasticsearch that referenced this issue Jul 14, 2014
Scripts can now be indexed like templates.
Anything that accepted a "script" argument now also supports an "id" or "file" argument.
For backwards compatiblity files referenced from the "script" argument are supported.
Indexed scripts now have CRUD endpoints under /_search/scripts/{lang}/{id} similar to templates.
Added a test for on disk scripts that was missing.

See elastic#5484 elastic#5921
GaelTadh added a commit that referenced this issue Jul 14, 2014
…cripts/template from an index.

This change allow elasticsearch users to store scripts and templates in an index for use at search time.
Scripts/Templates are stored in the .scripts index. The type of the events is set to the script language.
Templates use the mustache language so their type is be "mustache".
Adds the concept of a script type to calls to the ScriptService types are INDEXED,INLINE,FILE.
If a script type of INDEXED is supplied the script will be attempted to be loaded from the indexed, FILE will
look in the file cache and INLINE will treat the supplied script argument as the literal script.
REST endpoints are provided to do CRUD operations as is a java client library.
All query dsl points have been upgraded to allow passing in of explicit script ids and script file names.
Backwards compatible behavior has been preserved so this shouldn't break any existing querys that expect to
pass in a filename as the script/template name. The ScriptService will check the disk cache before parsing the
script.

Closes #5921 #5637 #5484
GaelTadh added a commit that referenced this issue Jul 14, 2014
…cripts/template from an index.

This change allow elasticsearch users to store scripts and templates in an index for use at search time.
Scripts/Templates are stored in the .scripts index. The type of the events is set to the script language.
Templates use the mustache language so their type is be "mustache".
Adds the concept of a script type to calls to the ScriptService types are INDEXED,INLINE,FILE.
If a script type of INDEXED is supplied the script will be attempted to be loaded from the indexed, FILE will
look in the file cache and INLINE will treat the supplied script argument as the literal script.
REST endpoints are provided to do CRUD operations as is a java client library.
All query dsl points have been upgraded to allow passing in of explicit script ids and script file names.
Backwards compatible behavior has been preserved so this shouldn't break any existing querys that expect to
pass in a filename as the script/template name. The ScriptService will check the disk cache before parsing the
script.

Closes #5921 #5637 #5484
@GaelTadh GaelTadh added v1.3.0 and removed v1.4.0 labels Jul 14, 2014
@GaelTadh
Copy link
Contributor

By e79b708

@jpountz jpountz removed the review label Jul 16, 2014
@clintongormley clintongormley changed the title Allow to run scripts/templates stored in .scripts index Scripting: Allow to run scripts/templates stored in .scripts index Jul 16, 2014
@clintongormley
Copy link

Closed by #5921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants