- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- RankingRecord
Ranks a list of text records based on the given input query.
HTTP request
POST https://discoveryengine.googleapis.com/v1/{rankingConfig=projects/*/locations/*/rankingConfigs/*}:rank
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
ranking |
Required. The resource name of the rank service config, such as |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"model": string,
"topN": integer,
"query": string,
"records": [
{
object ( |
Fields | |
---|---|
model |
The identifier of the model to use. It is one of:
It is set to |
top |
The number of results to return. If this is unset or no bigger than zero, returns all results. |
query |
The query to use. |
records[] |
Required. A list of records to rank. At most 200 records to rank. |
ignore |
If true, the response will contain only record ID and score. By default, it is false, the response will contain record details. |
user |
The user labels applied to a resource must meet the following requirements:
See Google Cloud Document for more details. |
Response body
Response message for RankService.Rank
method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"records": [
{
object ( |
Fields | |
---|---|
records[] |
A list of records sorted by descending score. |
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 rankingConfig
resource:
discoveryengine.rankingConfigs.rank
For more information, see the IAM documentation.
RankingRecord
Record message for RankService.Rank
method.
JSON representation |
---|
{ "id": string, "title": string, "content": string, "score": number } |
Fields | |
---|---|
id |
The unique ID to represent the record. |
title |
The title of the record. Empty by default. At least one of |
content |
The content of the record. Empty by default. At least one of |
score |
The score of this record based on the given query and selected model. The score will be rounded to 2 decimal places. If the score is close to 0, it will be rounded to 0.0001 to avoid returning unset. |