Read filter syntax

The following table details the syntax to use when filling out filter parameters (that is, f and fm) in Coveo Analytics Read API requests.

Symbol Operation Example

=~

Equals (case insensitive)

originlevel1 =~ "agentcasepanel"

!~

Not equal (case insensitive)

originlevel1 !~ "agentcasepanel"

==

Equals (case sensitive)

originlevel1 == "AgentCasePanel"

!=

Not equal (case sensitive)

originlevel1 != "AgentCasePanel"

=@

Contains (case insensitive)

originlevel1 =@ "Agent"

!@

Does not contain (case insensitive)

originlevel1 !@ "Agent"

<

Less than

PerformSearch < 100

<=

Less than or equal to

PerformSearch <= 100

>

Greater than

PerformSearch > 100

>=

Greater than or equal to

PerformSearch >= 100

IN

In array (case sensitive)

originlevel1 IN ["AgentCasePanel","InsightPanel"]

NOT_IN

Not in array (case sensitive)

originlevel1 NOT_IN ["AgentCasePanel","InsightPanel"]

AND

Logical AND

(groupname!=null) AND (originlevel1 IN ["AgentCasePanel","InsightPanel"])

OR

Logical OR

(groupname!=null) OR (originlevel1 IN ["AgentCasePanel","InsightPanel"])

Notes
  • AND applies by default when you send several f or fm parameters.

    For example, the following filter restricts an analytics request to events from two specific search hubs while excluding bot traffic by combining a named filter with an IN clause:

    $EXCLUDE_PAGEVIEW_BOTS AND (originlevel1 IN ["AgentCasePanel","InsightPanel"])

    where $EXCLUDE_PAGEVIEW_BOTS is the ID of a preexisting named filter. This is equivalent to sending two separate f parameters:

    &f=$EXCLUDE_PAGEVIEW_BOTS&f=(originlevel1 IN ["AgentCasePanel","InsightPanel"])
  • You can use either single (for example, 'Agent') or double (for example, "Agent") quotes to delimit strings.

  • To escape a quote in a string, use \.