If true, the response will contain only record ID and score. By default, it is false, the response will contain record details.
userLabels
map (key: string, value: string)
The user labels applied to a resource must meet the following requirements:
Each resource can have multiple labels, up to a maximum of 64.
Each label must be a key-value pair.
Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
The key portion of a label must be unique. However, you can use the same key with multiple resources.
Keys must start with a lowercase letter or international character.
The title of the record. Empty by default. At least one of title or content should be set otherwise an INVALID_ARGUMENT error is thrown.
content
string
The content of the record. Empty by default. At least one of title or content should be set otherwise an INVALID_ARGUMENT error is thrown.
score
number
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-30 UTC."],[[["\u003cp\u003eThis service ranks a list of text records based on an input query using a \u003ccode\u003ePOST\u003c/code\u003e request to the provided URL, specifying the ranking configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include parameters such as the model identifier (\u003ccode\u003emodel\u003c/code\u003e), the number of results to return (\u003ccode\u003etopN\u003c/code\u003e), the user's query (\u003ccode\u003equery\u003c/code\u003e), and a list of up to 200 records to rank (\u003ccode\u003erecords\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe response body contains a list of ranked records (\u003ccode\u003erecords[]\u003c/code\u003e) sorted by descending score, with each record including an ID, title, content, and a score, and the response can be configured to show record details or not.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this service requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope and the \u003ccode\u003ediscoveryengine.rankingConfigs.rank\u003c/code\u003e IAM permission on the ranking configuration resource.\u003c/p\u003e\n"],["\u003cp\u003eThe model defaults to \u003ccode\u003esemantic-ranker-512@latest\u003c/code\u003e, it has a maximum input token size of 512, and records in the request require either a title or content field to avoid an \u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e error.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.rankingConfigs.rank\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.RankResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [RankingRecord](#RankingRecord)\n - [JSON representation](#RankingRecord.SCHEMA_REPRESENTATION)\n\nRanks a list of text records based on the given input query.\n\n### HTTP request\n\n`POST https://discoveryengine.googleapis.com/v1beta/{rankingConfig=projects/*/locations/*/rankingConfigs/*}:rank`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nResponse message for [RankService.Rank](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.rankingConfigs/rank#google.cloud.discoveryengine.v1beta.RankService.Rank) method.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `rankingConfig` resource:\n\n- `discoveryengine.rankingConfigs.rank`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs).\n\nRankingRecord\n-------------\n\nRecord message for [RankService.Rank](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.rankingConfigs/rank#google.cloud.discoveryengine.v1beta.RankService.Rank) method."]]