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

EQL: implement case sensitivity for indexOf and endsWith string functions #57707

Merged
merged 3 commits into from
Jun 9, 2020

Conversation

aleksmaus
Copy link
Member

Addresses: #56750

Thanks @astefan for paving the way!

@aleksmaus aleksmaus added the :Analytics/EQL EQL querying label Jun 5, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/EQL)

@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label Jun 5, 2020
Copy link
Contributor

@astefan astefan left a 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() + ",{})");
Copy link
Contributor

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

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());
}

Copy link
Member Author

@aleksmaus aleksmaus Jun 9, 2020

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated PR

@aleksmaus aleksmaus merged commit e808026 into elastic:master Jun 9, 2020
aleksmaus added a commit to aleksmaus/elasticsearch that referenced this pull request Jun 10, 2020
…ions (elastic#57707)

* EQL: implement case sensitivity for indexOf and endsWith string functions
aleksmaus added a commit that referenced this pull request Jun 10, 2020
…ions (#57707) (#57908)

* EQL: implement case sensitivity for indexOf and endsWith string functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/EQL EQL querying Team:QL (Deprecated) Meta label for query languages team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants