ES|QL MV_RLIKE function
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Preview
Preview
Stack
Planned
Planned
Checks if any value of a multivalue field matches a regular expression.
field- Multivalue expression to test. If null or empty, the function returns
false. pattern-
Regular expression. Must be a constant. The pattern must match a value in full, as with
RLIKE.
Returns true when any value yielded by field matches pattern, using the same regular-expression syntax as RLIKE. The pattern must match a value in full, as with RLIKE. RLIKE is a single-value scalar: applied to a multivalue field it emits a warning and returns null, so this is how you match a regular expression against a multivalue field. A null or empty field returns false, and because the result is never null the predicate composes under AND/OR/NOT.
| field | pattern | result |
|---|---|---|
| keyword | keyword | boolean |
| keyword | text | boolean |
| text | keyword | boolean |
| text | text | boolean |
ROW names = ["Anna", "Bob", "Carl"]
| EVAL any_starts_with_a = mv_rlike(names, "A.*")
| names:keyword | any_starts_with_a:boolean |
|---|---|
| [Anna, Bob, Carl] | true |
Character classes work as they do in RLIKE:
ROW names = ["Anna", "Bob"]
| EVAL has_three_letter_b_name = mv_rlike(names, "[Bb]ob")
| names:keyword | has_three_letter_b_name:boolean |
|---|---|
| [Anna, Bob] | true |