Performs a search. Similar to the SearchService.Search
method, but a widget version that allows search without API Key. It supports search with or without JWT token.
HTTP request
POST https://discoveryengine.googleapis.com/v1alpha/{location=locations/*}/widgetSearch
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
location |
Required. The location resource where widget search will be performed. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "configId": string, "searchRequest": { object ( |
Fields | |
---|---|
configId |
Required. The UUID of the Search WidgetConfig. This field is used to identify the search widget configuration, set of models used to make the search. |
searchRequest |
Required. The search request to perform search. |
additionalParams |
Additional params for security and privacy enhancement. |
Response body
Response message for WidgetService.WidgetSearch
method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"searchResponse": {
object ( |
Fields | |
---|---|
searchResponse |
The search response after performing search. |
uToken |
The token in response. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
SearchRequest
Request message for SearchService.Search
method.
JSON representation |
---|
{ "servingConfig": string, "branch": string, "query": string, "imageQuery": { object ( |
Fields | |
---|---|
servingConfig |
Required. The resource name of the Search serving config, such as |
branch |
The branch resource name, such as Use |
query |
Raw search query. |
imageQuery |
Raw image query. |
pageSize |
Maximum number of If this field is negative, an |
pageToken |
A page token received from a previous 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 |
filter |
The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an |
orderBy |
The order in which documents are returned. Documents can be ordered by a field in an If this field is unrecognizable, an |
userInfo |
Information about the end user. Highly recommended for analytics. |
facetSpecs[] |
Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an |
boostSpec |
Boost specification to boost certain documents. |
params |
Additional search parameters. For public website search only, supported values are:
|
queryExpansionSpec |
The query expansion specification that specifies the conditions under which query expansion occurs. |
spellCorrectionSpec |
The spell correction specification that specifies the mode under which spell correction takes effect. |
userPseudoId |
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 field should NOT have a fixed value such as 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 |
contentSearchSpec |
A specification for configuring the behavior of content search. |
embeddingSpec |
Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document embedding that is provided in [SearchRequest.embedding_spec.embedding_vectors.field_path][]. If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not provided, it will use [ServingConfig.embedding_config.field_paths][]. |
rankingExpression |
The ranking expression controls the customized ranking on retrieval documents. This overrides Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be |
safeSearch |
Whether to turn on safe search. This is only supported for website search. |
userLabels |
The user labels applied to a resource must meet the following requirements:
See Google Cloud Document for more details. |