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, utilizing gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include a query string, an array of \u003ccode\u003eRankingRecord\u003c/code\u003e objects (up to 200), and can optionally specify the model, \u003ccode\u003etopN\u003c/code\u003e results, and whether to ignore record details in the response.\u003c/p\u003e\n"],["\u003cp\u003eThe response body returns a list of \u003ccode\u003eRankingRecord\u003c/code\u003e objects sorted by descending score, which is a numerical value representing the relevance of each record to the input query.\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 \u003ccode\u003erankingConfig\u003c/code\u003e resource.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRankingRecord\u003c/code\u003e object requires at least a value for either the title or content field, and must contain a unique record ID.\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/v1/{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/v1/projects.locations.rankingConfigs/rank#google.cloud.discoveryengine.v1.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/v1/projects.locations.rankingConfigs/rank#google.cloud.discoveryengine.v1.RankService.Rank) method."]]