contains

DPU:

variable

Purpose:

To filter for a word or a phrase.

Type:

The contains operator takes a string argument.

It uses tokenization on its arguments.

Case:

Not case sensitive. Add the cs keyword to create a case-sensitive filter with contains.

Syntax:

contains string

Synonyms:

contains_wordcontains_phrase

Examples:

  1. Filter for posts that include the phrase "web 2.0".

    interaction.content contains "web 2.0"

  2. Filter for activity from Tumblr blogs whose title contains the phrase "social media".

    tumblr.blog.name contains "social media"

  3. Filter for posts that include the word "LOUD" in upper case.

    interaction.content cs contains "LOUD"

  4. Filter for posts that include the word "quiet" in lower case.

    interaction.content cs contains "quiet"

  5. Filter for posts that include the word "Polish" but ignore posts that only mention "polish".

    interaction.content cs contains "Polish"

Notes:

To find a sequence of characters within a word, use the substr operator.

contains matches whole words or whole phrases. The filter:

interaction.contents contains "apple"

will not match: "They served ham and pineapple pizza."