Method: projects.locations.catalogs.placements.search

Performs a search.

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

HTTP request

POST https://retail.googleapis.com/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
placement

string

Required. The resource name of the Retail Search serving config, such as projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config or the name of the legacy placement resource, such as projects/*/locations/global/catalogs/default_catalog/placements/default_search. This field is used to identify the serving config name and the set of models that are used to make the search.

Request body

The request body contains data with the following structure:

JSON representation
{
  "branch": string,
  "query": string,
  "visitorId": string,
  "userInfo": {
    object (UserInfo)
  },
  "pageSize": integer,
  "pageToken": string,
  "offset": integer,
  "filter": string,
  "canonicalFilter": string,
  "orderBy": string,
  "facetSpecs": [
    {
      object (FacetSpec)
    }
  ],
  "dynamicFacetSpec": {
    object (DynamicFacetSpec)
  },
  "boostSpec": {
    object (BoostSpec)
  },
  "queryExpansionSpec": {
    object (QueryExpansionSpec)
  },
  "variantRollupKeys": [
    string
  ],
  "pageCategories": [
    string
  ],
  "searchMode": enum (SearchMode),
  "personalizationSpec": {
    object (PersonalizationSpec)
  },
  "labels": {
    string: string,
    ...
  },
  "entity": string,
  "conversationalSearchSpec": {
    object (ConversationalSearchSpec)
  },
  "tileNavigationSpec": {
    object (TileNavigationSpec)
  },
  "languageCode": string,
  "regionCode": string,
  "placeId": string,
  "userAttributes": {
    string: {
      object (StringList)
    },
    ...
  },
  "spellCorrectionSpec": {
    object (SpellCorrectionSpec)
  }
}
Fields
branch

string

The branch resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/0.

Use "default_branch" as the branch ID or leave this field empty, to search products under the default branch.

query

string

Raw search query.

If this field is empty, the request is considered a category browsing request and returned results are based on filter and pageCategories.

visitorId

string

Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.

This should be the same identifier as UserEvent.visitor_id.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

userInfo

object (UserInfo)

User information.

pageSize

integer

Maximum number of Products to return. If unspecified, defaults to a reasonable value. The maximum allowed value is 120. Values above 120 will be coerced to 120.

If this field is negative, an INVALID_ARGUMENT is returned.

pageToken

string

A page token SearchResponse.next_page_token, received from a previous SearchService.Search call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.

offset

integer

A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Products deemed by the API as relevant) in search results. This field is only considered if pageToken is unset.

If this field is negative, an INVALID_ARGUMENT is returned.

filter

string

The filter syntax consists of an expression language for constructing a predicate from one or more fields of the products being filtered. Filter expression is case-sensitive. For more information, see Filter.

If this field is unrecognizable, an INVALID_ARGUMENT is returned.

canonicalFilter

string

The default filter that is applied when a user performs a search without checking any filters on the search page.

The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality.

For more information about filter syntax, see SearchRequest.filter.

orderBy