- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Performs a search.
HTTP request
POST https://discoveryengine.googleapis.com/v1beta/{servingConfig=projects/*/locations/*/dataStores/*/servingConfigs/*}:search
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
servingConfig |
Required. The resource name of the servingConfigs.search serving config, such as |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "branch": string, "query": string, "imageQuery": { object ( |
Fields | |
---|---|
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 [ServingConfig.ranking_expression][]. The ranking expression is a single function or multiple functions that are joint by "+". * rankingExpression = function, { " + ", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: 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. |
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 the following IAM permission on the servingConfig
resource:
discoveryengine.servingConfigs.search
For more information, see the IAM documentation.