-
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
SCRIPTING: Move terms_set Context to its Own Class #33602
SCRIPTING: Move terms_set Context to its Own Class #33602
Conversation
original-brownbear
commented
Sep 11, 2018
- Extracted TermsSetQueryScript
- Kept mechanics close to what they were with SearchScript
* Extracted TermsSetQueryScript * Kept mechanics close to what they were with SearchScript
Pinging @elastic/es-core-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @original-brownbear. This looks good, except that it is missing backcompat, which I think is important. Eg doc
can be accessed through params.doc
. We need a way to detect and deprecate these uses. The current idea @jdconrad and I have discussed is a wrapper Map around params
that also takes in a set of keys that are deprecated, and the deprecation logger. Then on get
calls, the deprecated set can be checked. We could reuse this wrapper Map for converting the other script uses to contexts as well.
We could theoretically not have backcompat for |
Jup, the two of us discussed this too on Friday :) I'm fine adding an implementation of this here, it's really not that hard to implement and gives us a general solution to the problem. => go ahead an implement here? :) |
Sure, here is great! |
@rjernst done, let me know what you think about the approach of passing a map of keys to deprecation messages. I kinda liked this because it would give us a natural way of handling various messages where we want to give additional context like e.g. elasticsearch/server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java Line 293 in 79375d3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I wonder if the map to a full message is needed, or if we could just have the new variable name that should be used. This way the messages can be consistent for params deprecations.
@rjernst thanks!
I think in the vast majority of cases just having both variables would probably be enough. Also, I agree that it would be nice to enforce a consistent deprecation message. I'll merge this now so I can use it for another context :) I think we can easily make this change in a follow up PR. |
* master: (24 commits) Only notify ready global checkpoint listeners (elastic#33690) Don't count hits via the collector if the hit count can be computed from index stats. (elastic#33701) Expose retries for CCR fetch failures (elastic#33694) Test fix - Graph vertices could appear in different orders based on map insertion sequence (elastic#33709) Structured audit logging (elastic#31931) Core: Add DateFormatter interface for java time parsing (elastic#33467) [CCR] Check whether the rejected execution exception has the shutdown flag set (elastic#33703) Mute ClusterDisruptionIT#testSendingShardFailure Revert "Mute FullClusterRestartSettingsUpgradeIT" Adjust BWC version on settings upgrade test (elastic#33650) [ML] Allow overrides for some file structure detection decisions (elastic#33630) Adapt skip version for doc_values format deprecation [TEST] wait for no initializing shards [Docs] Minor fix in `has_child` javadoc comment (elastic#33674) Mute FullClusterRestartSettingsUpgradeIT [Kerberos] Add realm name & UPN to user metadata (elastic#33338) [TESTS] Disable specific locales for RestrictedTrustManagerTest (elastic#33299) SQL: Return functions in JDBC driver metadata (elastic#33672) SCRIPTING: Move terms_set Context to its Own Class (elastic#33602) AwaitsFix testRestoreMinmal ...
* Follow up to elastic#33602 adding the ability to compile TermsSetQuery scripts with the expressions engine in the same way we support SearchScript in Expressions * Duplicated the code here for now to make the change less complex, the only difference to SearchScript is that `_score` and `_value` are not handled for TermsSetQuery
* SCRIPTING: Move terms_set Context to its Own Class * Extracted TermsSetQueryScript * Kept mechanics close to what they were with SearchScript
* SCRIPTING: Add Expr. Compile for TermSetQuery Ctx. * Follow up to #33602 adding the ability to compile TermsSetQuery scripts with the expressions engine in the same way we support SearchScript in Expressions * Duplicated the code here for now to make the change less complex, the only difference to SearchScript is that `_score` and `_value` are not handled for TermsSetQuery * remove redundant check
* SCRIPTING: Add Expr. Compile for TermSetQuery Ctx. * Follow up to #33602 adding the ability to compile TermsSetQuery scripts with the expressions engine in the same way we support SearchScript in Expressions * Duplicated the code here for now to make the change less complex, the only difference to SearchScript is that `_score` and `_value` are not handled for TermsSetQuery * remove redundant check