Google Cloud Retail V2 Client - Class Condition (2.1.0)

Reference documentation and code samples for the Google Cloud Retail V2 Client class Condition.

Metadata that is used to define a condition that triggers an action.

A valid condition must specify at least one of 'query_terms' or 'products_filter'. If multiple fields are specified, the condition is met if all the fields are satisfied e.g. if a set of query terms and product_filter are set, then only items matching the product_filter for requests with a query matching the query terms wil get boosted.

Generated from protobuf message google.cloud.retail.v2.Condition

Namespace

Google \ Cloud \ Retail \ V2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ query_terms array<Google\Cloud\Retail\V2\Condition\QueryTerm>

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

↳ active_time_range array<Google\Cloud\Retail\V2\Condition\TimeRange>

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

↳ page_categories array

Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

getQueryTerms

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries.

If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setQueryTerms

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries.

If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

Parameter
Name Description
var array<Google\Cloud\Retail\V2\Condition\QueryTerm>
Returns
Type Description
$this

getActiveTimeRange

Range of time(s) specifying when Condition is active.

Condition true if any time range matches.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setActiveTimeRange

Range of time(s) specifying when Condition is active.

Condition true if any time range matches.

Parameter
Name Description
var array<Google\Cloud\Retail\V2\Condition\TimeRange>
Returns
Type Description
$this

getPageCategories

Used to support browse uses cases.

A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setPageCategories

Used to support browse uses cases.

A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

Parameter
Name Description
var string[]
Returns
Type Description
$this