# Google Cloud Discovery Engine V1 Client - Class RankingRecord (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 RankingRecord.

Record 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.RankingRecord`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ id` | `string` The unique ID to represent the record. |
| `↳ title` | `string` The title of the record. Empty by default. At least one of [title](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or [content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) 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](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or [content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) should be set otherwise an INVALID_ARGUMENT error is thrown. |
| `↳ score` | `float` 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. |

### getId

The unique ID to represent the record.

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

### setId

The unique ID to represent the record.

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

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

### getTitle

The title of the record. Empty by default.

At least one of
[title](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or
[content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) should be
set otherwise an INVALID_ARGUMENT error is thrown.

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

### setTitle

The title of the record. Empty by default.

At least one of
[title](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or
[content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) should be
set otherwise an INVALID_ARGUMENT error is thrown.

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

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

### getContent

The content of the record. Empty by default.

At least one of
[title](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or
[content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) should be
set otherwise an INVALID_ARGUMENT error is thrown.

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

### setContent

The content of the record. Empty by default.

At least one of
[title](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getTitle__) or
[content](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.RankingRecord#_Google_Cloud_DiscoveryEngine_V1_RankingRecord__getContent__) should be
set otherwise an INVALID_ARGUMENT error is thrown.

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

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

### getScore

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setScore

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.

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

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