- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Performs a search.
This feature is only available for users who have Retail servingConfigs.search enabled. Enable Retail servingConfigs.search on Cloud Console before using this feature.
HTTP request
POST https://retail.googleapis.com/v2alpha/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
placement |
Required. The resource name of the Retail servingConfigs.search serving config, such as |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "branch": string, "query": string, "visitorId": string, "userInfo": { object ( |
Fields | |
---|---|
branch |
The branch resource name, such as Use "default_branch" as the branch ID or leave this field empty, to search products under the default branch. |
query |
Raw search query. If this field is empty, the request is considered a category browsing request and returned results are based on |
visitorId |
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 The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
userInfo |
User information. |
pageSize |
Maximum number of If this field is negative, an INVALID_ARGUMENT is returned. |
pageToken |
A page token When paginating, all other parameters provided to |
offset |
A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the If this field is negative, an INVALID_ARGUMENT is returned. |
filter |
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 |
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. For example, if a query does not have enough results, an expanded query with For more information about filter syntax, see |
orderBy |
The order in which products are returned. Products can be ordered by a field in an If this field is unrecognizable, an INVALID_ARGUMENT is returned. |
facetSpecs[] |
Facet specifications for faceted search. If empty, no facets are returned. A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned. |
dynamicFacetSpec |
Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic to enable dynamic facets. Do not set this field. The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated. |
boostSpec |
Boost specification to boost certain products. For more information, see Boost results. Notice that if both |
queryExpansionSpec |
The query expansion specification that specifies the conditions under which query expansion occurs. For more information, see Query expansion. |
relevanceThreshold |
The relevance threshold of the search results. Defaults to |
variantRollupKeys[] |
The keys to fetch and rollup the matching For Supported keys are:
If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. |
pageCategories[] |
The categories associated with a category page. Must be set for category navigation queries to achieve good search quality. The format should be the same as To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday Deals"]. |
searchMode |
The search mode of the search request. If not specified, a single search request triggers both product search and faceted search. |
personalizationSpec |
The specification for personalization. Notice that if both |
labels |
The labels applied to a resource must meet the following requirements:
For more information, see Requirements for labels in the Resource Manager documentation. |
entity |
The entity for customers that may run multiple different entities, domains, sites or regions, for example, |
spellCorrectionSpec |
The spell correction specification that specifies the mode under which spell correction will take effect. |
Response body
If successful, the response body contains an instance of SearchResponse
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires one of the following IAM permissions on the placement
resource, depending on the resource type:
retail.placements.search
retail.servingConfigs.search
For more information, see the IAM documentation.