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
Better categories for scripted operations #10347
Comments
hey @uboness @clintongormley can you comment on this please? |
@javanna for now, plugins I know basically use scripts to modify documents before injection. That was mostly the case for some rivers. Not sure we need something else. |
@dadoonet yea it makes sense to use update for now but it's ambiguous because it's not really about the update api, but pre-processing of document before they get indexed. I am for making it explicit that plugins may use scripts and we just don't know exactly for what :) |
@javanna thinking a few things:
|
I agree with @uboness on making things more flexible, maybe we could just use the plugin name though instead of having plugins declare potentially multiple additional contexts (think of conflicting ones as well). Let's see what others think about this aspect. That said I think we should move on with the first step of introducing an additional category that is specific for plugins, which would also have the advantage of allowing us to restore backwards compatibility on |
I can see multiple categories used within a single plugin as well... so maybe then we'll have the category be prefixed with the plugin name... as a convention at least?
+1 |
Plugins can make use of scripts and expose custom scripting features. Fine-grained settings introduced with elastic#10116 don't support any custom use of scripts, hence plugins are forced to choose between update, mapping, search and aggs. Introduced a new generic plugins category that can be used by plugins. Fine-grained settings apply as well: `script.plugins: off` disable any script type, for any language, only when scripts are used from plugins. `script.engine.groovy.inline.plugins: off` disables scripts when used as part of plugins, only for inline scripts and groovy language. Relates to elastic#10347
Plugins can make use of scripts and expose custom scripting features. Fine-grained settings introduced with elastic#10116 don't support any custom use of scripts, hence plugins are forced to choose between update, mapping, search and aggs. Introduced a new generic plugins category that can be used by plugins. Fine-grained settings apply as well: `script.plugins: off` disable any script type, for any language, only when scripts are used from plugins. `script.engine.groovy.inline.plugins: off` disables scripts when used as part of plugins, only for inline scripts and groovy language. Relates to elastic#10347
+1 to #10347 (comment) |
…ripts for Plugins can now define multiple operations/contexts that they use scripts for. Fine-grained settings can then be used to enable/disable scripts based on each single registered context. Also added a new generic category called `plugins`, which will be used as a default when the context is not specified. This allows us to restore backwards compatibility for plugins on `ScriptService` by restoring the old methods that don't require the script context and making them internally use the `plugins` context, as they can only be called from plugins. Closes elastic#10347
…ripts for Plugins can now define multiple operations/contexts that they use scripts for. Fine-grained settings can then be used to enable/disable scripts based on each single registered context. Also added a new generic category called `plugin`, which will be used as a default when the context is not specified. This allows us to restore backwards compatibility for plugins on `ScriptService` by restoring the old methods that don't require the script context and making them internally use the `plugin` context, as they can only be called from plugins. Closes #10347 Closes #10419
With #10116 we introduced fine-grained script settings. Each time a script is run, it is associated with a context, which holds the operation/api that is making use of the script, provided by the caller.
We currently support 4 operations:
search
,mapping
,update
andaggs
. We folded suggester and percolator under search though, which might be confusing for users, hence we might want to create proper distinct categories for them.Even more importantly, plugins may use our
ScriptService
to expose custom scripted operations, which may not fall into these pre-defined categories. I wonder if we should introduce a new generic category of operations for plugins, which can be enabled/disabled via settings too. This way we may also be able to remove the breaking aspect of this new feature, the problem being that each caller needs to specify which operation it's using the script for, and that is a required argument. Given that we updated all of our internal calls to provide that argument, we could now restore the original methods without theScriptContext
argument and assume that those calls come from plugins, by assigning them the default plugins category.The text was updated successfully, but these errors were encountered: