Contents

FilterCondition

A single filter condition used in a recommendation query request to narrow results.

Declaration

object RecommendationFilterCondition

Properties

NameTypeDescription
field Requiredstring

The name of the field to filter on. Must match a field name on the recommendation object being queried, for example state, promotedObjectId, campaignId.

operator RequiredRecommendationFilterOperator

The comparison operator to apply. See FilterOperator.

value Required[string]

An array of one or more filter values. Always supplied as an array, even when filtering with a single value, for example value: [AVAILABLE].

ignoreCaseboolean

When true, string matching is case-insensitive. Defaults to false.

Discussion

The FilterCondition object is the building block of query filters in the Recommendations API. The API combines multiple conditions in the filters array with AND logic. All conditions must match for a recommendation to appear in results.

Every query request requires two filters:

Field

Operator

Description

promotedObjectId

EQUALS

The ID of the promoted object. Interpreted in combination with promotedObjectType.

promotedObjectType

EQUALS

The type of promoted object, for example APPSTORE_APP.

Which operators are valid for a given field depends on that field’s underlying type.

Field Type

Supported Operators

String

EQUALS, NOT_EQUALS, IN, STARTS_WITH, ENDS_WITH, LIKE

Numeric

EQUALS, NOT_EQUALS, IN, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, LESS_THAN, LESS_THAN_OR_EQUAL_TO, BETWEEN

Date

EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL_TO, LESS_THAN, LESS_THAN_OR_EQUAL_TO

Enum

EQUALS, NOT_EQUALS, IN

List

CONTAINS_ANY, CONTAINS_ALL

Always pass value as an array.

Example

{
  "field": "state",
  "operator": "EQUALS",
  "value": [
    "AVAILABLE"
  ],
  "ignoreCase": false
}

See Also