Table of Contents

Search

  1. Preface
  2. RulePoint
  3. RulePoint Concepts
  4. Using RulePoint
  5. RulePoint Objects
  6. Working with Topics
  7. Working with Connections
  8. Working with Sources
  9. Working with Responders
  10. Working with Responses
  11. Working with Watchlists
  12. Working with Analytics
  13. DRQL
  14. Working with Rules
  15. Working with Alerts
  16. Setting Access Controls
  17. Troubleshooting RulePoint Issues
  18. Connecting to an Ultra Messaging Application
  19. Creating an Ultra Messaging JMS Source

User Guide

User Guide

contains

contains

The contains operator performs word and substring search on event properties, but functions differently based on operations of the rule.
The contains analytic computes the following types of object:
  • Item. An item is a property of an event, a text watchlist, or a single value returned from an analytic function.
  • List. A list is a watchlist, an array returned from an analytic function, or a temporary variable list.
  • Set. A set is an event set that is typically pooled from a WHEN n set rule.

Item

When the item object
contains an item
, the contains analytic returns true if the item on the right exists in the item on the left. When a rule includes two items, the contains analytic uses a substring match to check whether the item contains all elements of the set. For example, in the following rule, the analytic checks whether the news tagline contains the phrase,
days
:
WHEN 1 news n WITH n.tagline contains "days" then response
When the item object
contains a list
, the contains analytic returns true if any element in the list exists in the item on the left. When the rule includes an item and then a list, the analytic uses a word boundary match to check whether the single item contains any of the items in the list. For example, in the following rule, the analytic verifies whether the tagline contains any of the elements in the following watchlist:
WHEN 1 news n WITH n.tagline contains watchlist:myList then response
When the item object
contains a set
, the contains analytic returns true if all elements in the set exist in the item on the left. When the rule includes an item and then a set, the analytic uses a word boundary match to check whether the item contains all elements of the set on the right. For example, in the following rule, the analytic verifies whether the tagline contains all of the keywords in the following set:
WHEN 1 news n WITH n.tagline contains mySet then response

List

When the list object
contains an item
, the contains analytic returns true if any element in the left list is an exact match to the item. When the rule includes a list and then an item, the analytic checks whether any of the elements in the list is an exact match to the item on the right. For example, in the following rule, the analytic verifies whether the watchlist,
myList
, contains the tagline:
WHEN 1 news n WITH watchlist:myList contains n.tagline then response
When the list object
contains a list
, the contains analytic returns true if any element in the left list is an exact match for any item in the right list. When the rule includes a list and then a list, the analytic checks whether any of the elements in the list on the left is an exact match to any item on the list on the right hand side. For example, in the following rule, the analytic verifies whether the tagline contains any of the elements in the
myList
watchlist:
WHEN 1 news n with sqlQuery(n.id) contains watchlist:myList then response
When the list object
contains a set
, the contains analytic returns true if any element of the list is an exact match for all items in the set. The elements do not have to be the same element in the list. When the rule includes a list and then a set, the analytic checks whether any of the elements in the list on the left is an exact match to all items in the set on the right hand side. For example, in the following rule, the analytic verifies whether the
myList
watchlist contains all of the elements in the tagline set:
WHEN 1 news n WITH watchlist:myKeywords contains n.tagline then response

Set

When the set object
contains an item
, the contains analytic returns true if the item on the right exists in all elements in the set. When the rule includes a set and then an item, the analytic uses a word boundary match to check whether the item on the right is a match to all items in the set. For example, in the following rule, the analytic verifies whether the tagline set contains the keyword in the
myItem
watchlist:
WHEN 3 news n WITH n.tagline contains Watchlist:myItem then response
The behavior is different when you use the past() analytic with the contains() analytic. The past() analytic computes events as a set, but in this instance it considers the events as a list. Therefore, RulePoint checks whether any of the elements in the list is an exact match to the item on the right as opposed to word boundary matching.
When the set object
contains a list
, the contains analytic returns true if any element of the list exists in all elements in the set. The elements do not have to be the same element in the list. When the rule includes a set and then a list, the analytic uses a word boundary match to check whether any element of the list exists in all items in the set. For example, in the following rule, the analytic verifies whether the
myList
watchlist set contains all of the elements in the tagline:
WHEN 3 news n WITH n.tagline contains Watchlist:myList then response
When the set object
contains a set
, the contains analytic returns true if all elements in the right set exist, using a word boundary match, in all elements in the left set . When the rule includes a set and then a set, the analytic uses a word boundary match to check whether all elements in the right hand set exist in all elements of the left hand set. The elements do not have to be the same element in the left set. For example, in the following rule, the analytic verifies whether the tagline set contains all of the elements in the
mySet
watchlist:
WHEN 3 news n, 3 Stock s WITH n.tagline contains s.symbol then response

0 COMMENTS

We’d like to hear from you!