-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Add more contexts to painless execute api #30511
Merged
martijnvg
merged 16 commits into
elastic:master
from
martijnvg:painless_execute_api_add_more_contexts
Jul 18, 2018
Merged
Add more contexts to painless execute api #30511
martijnvg
merged 16 commits into
elastic:master
from
martijnvg:painless_execute_api_add_more_contexts
Jul 18, 2018
Commits on May 22, 2018
-
[Painless] Add more contexts to painless execute api
This change adds two contexts the execute scripts against: * SEARCH_SCRIPT: Allows to run scripts in a search script context. This context is used in `function_score` query's script function, script fields, script sorting and `terms_set` query. * FILTER_SCRIPT: Allows to run scripts in a filter script context. This context is used in the `script` query. In both contexts a index name needs to be specified and a sample document. The document is needed to create an in-memory index that the script can access via the `doc[...]` and other notations. The index name is needed because a mapping is needed to index the document. Examples: ``` POST /_scripts/painless/_execute { "script": { "source": "doc['field'].value.length()" }, "context" : { "search_script": { "document": { "field": "four" }, "index": "my-index" } } } ``` Returns: ``` { "result": 4 } ``` POST /_scripts/painless/_execute { "script": { "source": "doc['field'].value.length() <= params.max_length", "params": { "max_length": 4 } }, "context" : { "filter_script": { "document": { "field": "four" }, "index": "my-index" } } } Returns: ``` { "result": true } ```
Configuration menu - View commit details
-
Copy full SHA for 3e78138 - Browse repository at this point
Copy the full SHA 3e78138View commit details
Commits on May 23, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e86764a - Browse repository at this point
Copy the full SHA e86764aView commit details -
changed PainlessExecuteAction.TransportAction to use TransportSingleS…
…hardAction instead of HandledAction, because now in case score or filter contexts are used the request needs to be redirected to a node that has an active IndexService for the index being referenced (a node with a shard copy for that index).
Configuration menu - View commit details
-
Copy full SHA for d965597 - Browse repository at this point
Copy the full SHA d965597View commit details
Commits on May 24, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 636ad34 - Browse repository at this point
Copy the full SHA 636ad34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 539abde - Browse repository at this point
Copy the full SHA 539abdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bc755c - Browse repository at this point
Copy the full SHA 7bc755cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 65bbaf8 - Browse repository at this point
Copy the full SHA 65bbaf8View commit details
Commits on May 25, 2018
-
Configuration menu - View commit details
-
Copy full SHA for f82c307 - Browse repository at this point
Copy the full SHA f82c307View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd3fb41 - Browse repository at this point
Copy the full SHA fd3fb41View commit details -
Configuration menu - View commit details
-
Copy full SHA for caf6f26 - Browse repository at this point
Copy the full SHA caf6f26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6da0dc7 - Browse repository at this point
Copy the full SHA 6da0dc7View commit details
Commits on Jul 4, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e3437cf - Browse repository at this point
Copy the full SHA e3437cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95300fe - Browse repository at this point
Copy the full SHA 95300feView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3eab3f - Browse repository at this point
Copy the full SHA f3eab3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3afa5d0 - Browse repository at this point
Copy the full SHA 3afa5d0View commit details
Commits on Jul 18, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 9b3b67e - Browse repository at this point
Copy the full SHA 9b3b67eView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.