-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[DOCS] EQL: Document endsWith
function
#54521
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
Conversation
Pinging @elastic/es-docs (>docs) |
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 in general. Left one comment that should be valid for other string functions, as well. Thank you.
(Required, string or `null`) | ||
Source string. If `null`, the function returns `null`. | ||
+ | ||
If using a field as the argument, this parameter only supports the |
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.
With this PR I realized one small aspect here. It should be valid for all other string functions, though.
One can use a text
field in the function and there won't be any exception and the query will work if that text
field will have a keyword
sub-field.
For example, the following mapping
"hostname" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
and the query process where endsWith(hostname, "foo") == true
won't trigger an error.
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.
Valid statement for the other parameter, as well.
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 again for pointing this out. Addressed with 508be06.
[[eql-fn-endswith]] | ||
=== `endsWith` | ||
|
||
Returns `true` if a source string ends with a provided substring. |
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.
This function is case insensitive, as well. And I believe it's worth being mentioned in docs.
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! Addressed with 508be06.
Adds documentation for the EQL
endsWith
function.Relates to #54442.