ES|QL CONTAINS function
string- String expression: input string to check against. If
null, the function returnsnull. substring-
String expression: A substring to find in the input string. If
null, the function returnsnull.
Returns a boolean that indicates whether a keyword substring is within another string. Returns null if either parameter is null.
| string | substring | result |
|---|---|---|
| keyword | keyword | boolean |
| keyword | text | boolean |
| text | keyword | boolean |
| text | text | boolean |
ROW a = "hello"
| EVAL has_ll = CONTAINS(a, "ll")
| a:keyword | has_ll:boolean |
|---|---|
| hello | true |