Google Cloud Discovery Engine V1 Client - Class RankRequest (1.0.0-RC1)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class RankRequest.

Request message for RankService.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_id}/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 maxiumn 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<Google\Cloud\DiscoveryEngine\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|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 for more details.

getRankingConfig

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/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_id}/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 maxiumn 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 maxiumn 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
Google\Protobuf\Internal\RepeatedField

setRecords

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

Parameter
Name Description
var array<Google\Cloud\DiscoveryEngine\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 for more details.
Returns
Type Description
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 for more details.
Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this