-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
EQL: implement case sensitivity for indexOf and endsWith string functions #57707
EQL: implement case sensitivity for indexOf and endsWith string functions #57707
Conversation
Pinging @elastic/es-ql (:Query Languages/EQL) |
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
.build(), dataType()); | ||
ParamsBuilder params = paramsBuilder(); | ||
|
||
String template = formatTemplate("{eql}.endsWith(" + sourceScript.template() + "," + patternScript.template() + ",{})"); |
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.
We're not totally consistent in these. Here's something I did for stringContains
Lines 87 to 98 in 8fb5b56
protected ScriptTemplate asScriptFrom(ScriptTemplate stringScript, ScriptTemplate substringScript) { | |
return new ScriptTemplate(format(Locale.ROOT, formatTemplate("{eql}.%s(%s,%s,%s)"), | |
"stringContains", | |
stringScript.template(), | |
substringScript.template(), | |
"{}"), | |
paramsBuilder() | |
.script(stringScript.params()) | |
.script(substringScript.params()) | |
.variable(isCaseSensitive()) | |
.build(), dataType()); | |
} |
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.
Followed Andrei's implementation for consistency, can change back. Let me know.
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.
Updated PR
…ions (elastic#57707) * EQL: implement case sensitivity for indexOf and endsWith string functions
Addresses: #56750
Thanks @astefan for paving the way!