# Google Cloud Discovery Engine V1 Client - Class RankRequest (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class RankRequest.

Request message for
[RankService.Rank](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.RankServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_RankServiceClient__rank__) method.

Generated from protobuf message `google.cloud.discoveryengine.v1.RankRequest`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ ranking_config` | `string` Required. The resource name of the rank service config, such as `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. |
| `↳ model` | `string` The identifier of the model to use. It is one of: \* \* `semantic-ranker-512\@latest`: Semantic ranking model with maximum input token size 512. It is set to `semantic-ranker-512\@latest` by default if unspecified. |
| `↳ top_n` | `int` The number of results to return. If this is unset or no bigger than zero, returns all results. |
| `↳ query` | `string` The query to use. |
| `↳ records` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord>` Required. A list of records to rank. At most 200 records to rank. |
| `↳ ignore_record_details_in_response` | `bool` If true, the response will contain only record ID and score. By default, it is false, the response will contain record details. |
| `↳ user_labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` 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. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details. |

### getRankingConfig

Required. The resource name of the rank service config, such as
`projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRankingConfig

Required. The resource name of the rank service config, such as
`projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getModel

The identifier of the model to use. It is one of:

- `semantic-ranker-512\@latest`: Semantic ranking model with maximum input token size 512.

It is set to `semantic-ranker-512\@latest` by default if unspecified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setModel

The identifier of the model to use. It is one of:

- `semantic-ranker-512\@latest`: Semantic ranking model with maximum input token size 512.

It is set to `semantic-ranker-512\@latest` by default if unspecified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTopN

The number of results to return. If this is unset or no bigger than zero,
returns all results.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setTopN

The number of results to return. If this is unset or no bigger than zero,
returns all results.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuery

The query to use.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setQuery

The query to use.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRecords

Required. A list of records to rank. At most 200 records to rank.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord>` |   |

### setRecords

Required. A list of records to rank. At most 200 records to rank.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getIgnoreRecordDetailsInResponse

If true, the response will contain only record ID and score. By default, it
is false, the response will contain record details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setIgnoreRecordDetailsInResponse

If true, the response will contain only record ID and score. By default, it
is false, the response will contain record details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUserLabels

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. See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setUserLabels

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. See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |