ES|QL STARTS_WITH function
str- String expression. If
null, the function returnsnull. prefix-
String expression. If
null, the function returnsnull.
Returns a boolean that indicates whether a keyword string starts with another string.
| str | prefix | result |
|---|---|---|
| keyword | keyword | boolean |
| keyword | text | boolean |
| text | keyword | boolean |
| text | text | boolean |
FROM employees
| KEEP last_name
| EVAL ln_S = STARTS_WITH(last_name, "B")
| last_name:keyword | ln_S:boolean |
|---|---|
| Awdeh | false |
| Azuma | false |
| Baek | true |
| Bamford | true |
| Bernatsky | true |