Class ServingConfig.Builder (2.55.0)

public static final class ServingConfig.Builder extends GeneratedMessageV3.Builder<ServingConfig.Builder> implements ServingConfigOrBuilder

Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions).

Protobuf type google.cloud.retail.v2.ServingConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllBoostControlIds(Iterable<String> values)

public ServingConfig.Builder addAllBoostControlIds(Iterable<String> values)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameter
Name Description
values Iterable<String>

The boostControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllDoNotAssociateControlIds(Iterable<String> values)

public ServingConfig.Builder addAllDoNotAssociateControlIds(Iterable<String> values)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameter
Name Description
values Iterable<String>

The doNotAssociateControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllFacetControlIds(Iterable<String> values)

public ServingConfig.Builder addAllFacetControlIds(Iterable<String> values)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameter
Name Description
values Iterable<String>

The facetControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllFilterControlIds(Iterable<String> values)

public ServingConfig.Builder addAllFilterControlIds(Iterable<String> values)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameter
Name Description
values Iterable<String>

The filterControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllIgnoreControlIds(Iterable<String> values)

public ServingConfig.Builder addAllIgnoreControlIds(Iterable<String> values)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameter
Name Description
values Iterable<String>

The ignoreControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllOnewaySynonymsControlIds(Iterable<String> values)

public ServingConfig.Builder addAllOnewaySynonymsControlIds(Iterable<String> values)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameter
Name Description
values Iterable<String>

The onewaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllRedirectControlIds(Iterable<String> values)

public ServingConfig.Builder addAllRedirectControlIds(Iterable<String> values)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameter
Name Description
values Iterable<String>

The redirectControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllReplacementControlIds(Iterable<String> values)

public ServingConfig.Builder addAllReplacementControlIds(Iterable<String> values)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameter
Name Description
values Iterable<String>

The replacementControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllSolutionTypes(Iterable<? extends SolutionType> values)

public ServingConfig.Builder addAllSolutionTypes(Iterable<? extends SolutionType> values)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
values Iterable<? extends com.google.cloud.retail.v2.SolutionType>

The solutionTypes to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllSolutionTypesValue(Iterable<Integer> values)

public ServingConfig.Builder addAllSolutionTypesValue(Iterable<Integer> values)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
values Iterable<Integer>

The enum numeric values on the wire for solutionTypes to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addAllTwowaySynonymsControlIds(Iterable<String> values)

public ServingConfig.Builder addAllTwowaySynonymsControlIds(Iterable<String> values)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameter
Name Description
values Iterable<String>

The twowaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addBoostControlIds(String value)

public ServingConfig.Builder addBoostControlIds(String value)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameter
Name Description
value String

The boostControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addBoostControlIdsBytes(ByteString value)

public ServingConfig.Builder addBoostControlIdsBytes(ByteString value)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameter
Name Description
value ByteString

The bytes of the boostControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addDoNotAssociateControlIds(String value)

public ServingConfig.Builder addDoNotAssociateControlIds(String value)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameter
Name Description
value String

The doNotAssociateControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addDoNotAssociateControlIdsBytes(ByteString value)

public ServingConfig.Builder addDoNotAssociateControlIdsBytes(ByteString value)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameter
Name Description
value ByteString

The bytes of the doNotAssociateControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addFacetControlIds(String value)

public ServingConfig.Builder addFacetControlIds(String value)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameter
Name Description
value String

The facetControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addFacetControlIdsBytes(ByteString value)

public ServingConfig.Builder addFacetControlIdsBytes(ByteString value)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameter
Name Description
value ByteString

The bytes of the facetControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addFilterControlIds(String value)

public ServingConfig.Builder addFilterControlIds(String value)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameter
Name Description
value String

The filterControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addFilterControlIdsBytes(ByteString value)

public ServingConfig.Builder addFilterControlIdsBytes(ByteString value)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameter
Name Description
value ByteString

The bytes of the filterControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addIgnoreControlIds(String value)

public ServingConfig.Builder addIgnoreControlIds(String value)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameter
Name Description
value String

The ignoreControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addIgnoreControlIdsBytes(ByteString value)

public ServingConfig.Builder addIgnoreControlIdsBytes(ByteString value)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameter
Name Description
value ByteString

The bytes of the ignoreControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addOnewaySynonymsControlIds(String value)

public ServingConfig.Builder addOnewaySynonymsControlIds(String value)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameter
Name Description
value String

The onewaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addOnewaySynonymsControlIdsBytes(ByteString value)

public ServingConfig.Builder addOnewaySynonymsControlIdsBytes(ByteString value)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameter
Name Description
value ByteString

The bytes of the onewaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addRedirectControlIds(String value)

public ServingConfig.Builder addRedirectControlIds(String value)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameter
Name Description
value String

The redirectControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addRedirectControlIdsBytes(ByteString value)

public ServingConfig.Builder addRedirectControlIdsBytes(ByteString value)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameter
Name Description
value ByteString

The bytes of the redirectControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ServingConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ServingConfig.Builder
Overrides

addReplacementControlIds(String value)

public ServingConfig.Builder addReplacementControlIds(String value)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameter
Name Description
value String

The replacementControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addReplacementControlIdsBytes(ByteString value)

public ServingConfig.Builder addReplacementControlIdsBytes(ByteString value)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameter
Name Description
value ByteString

The bytes of the replacementControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addSolutionTypes(SolutionType value)

public ServingConfig.Builder addSolutionTypes(SolutionType value)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value SolutionType

The solutionTypes to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addSolutionTypesValue(int value)

public ServingConfig.Builder addSolutionTypesValue(int value)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value int

The enum numeric value on the wire for solutionTypes to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addTwowaySynonymsControlIds(String value)

public ServingConfig.Builder addTwowaySynonymsControlIds(String value)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameter
Name Description
value String

The twowaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

addTwowaySynonymsControlIdsBytes(ByteString value)

public ServingConfig.Builder addTwowaySynonymsControlIdsBytes(ByteString value)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameter
Name Description
value ByteString

The bytes of the twowaySynonymsControlIds to add.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

build()

public ServingConfig build()
Returns
Type Description
ServingConfig

buildPartial()

public ServingConfig buildPartial()
Returns
Type Description
ServingConfig

clear()

public ServingConfig.Builder clear()
Returns
Type Description
ServingConfig.Builder
Overrides

clearBoostControlIds()

public ServingConfig.Builder clearBoostControlIds()

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearDisplayName()

public ServingConfig.Builder clearDisplayName()

Required. The human readable serving config display name. Used in Retail UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearDiversityLevel()

public ServingConfig.Builder clearDiversityLevel()

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity

    If not specified, we choose default based on recommendation model type. Default value: no-diversity.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string diversity_level = 8;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearDiversityType()

public ServingConfig.Builder clearDiversityType()

What kind of diversity to use - data driven or rule based. If unset, the server behavior defaults to RULE_BASED_DIVERSITY.

.google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearDoNotAssociateControlIds()

public ServingConfig.Builder clearDoNotAssociateControlIds()

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearDynamicFacetSpec()

public ServingConfig.Builder clearDynamicFacetSpec()

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Returns
Type Description
ServingConfig.Builder

clearEnableCategoryFilterLevel()

public ServingConfig.Builder clearEnableCategoryFilterLevel()

Whether to add additional category filters on the similar-items model. If not specified, we enable it by default. Allowed values are:

  • no-category-match: No additional filtering of original results from the model and the customer's filters.
  • relaxed-category-match: Only keep results with categories that match at least one item categories in the PredictRequests's context item.

    • If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match).

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string enable_category_filter_level = 16;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearFacetControlIds()

public ServingConfig.Builder clearFacetControlIds()

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ServingConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ServingConfig.Builder
Overrides

clearFilterControlIds()

public ServingConfig.Builder clearFilterControlIds()

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearIgnoreControlIds()

public ServingConfig.Builder clearIgnoreControlIds()

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearIgnoreRecsDenylist()

public ServingConfig.Builder clearIgnoreRecsDenylist()

When the flag is enabled, the products in the denylist will not be filtered out in the recommendation filtering results.

bool ignore_recs_denylist = 24;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearModelId()

public ServingConfig.Builder clearModelId()

The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR).

Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.

string model_id = 3;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearName()

public ServingConfig.Builder clearName()

Immutable. Fully qualified name projects/*/locations/global/catalogs/*/servingConfig/*

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public ServingConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ServingConfig.Builder
Overrides

clearOnewaySynonymsControlIds()

public ServingConfig.Builder clearOnewaySynonymsControlIds()

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearPersonalizationSpec()

public ServingConfig.Builder clearPersonalizationSpec()

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Returns
Type Description
ServingConfig.Builder

clearPriceRerankingLevel()

public ServingConfig.Builder clearPriceRerankingLevel()

How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are:

  • no-price-reranking
  • low-price-reranking
  • medium-price-reranking
  • high-price-reranking

    If not specified, we choose default based on model type. Default value: no-price-reranking.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string price_reranking_level = 4;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearRedirectControlIds()

public ServingConfig.Builder clearRedirectControlIds()

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearReplacementControlIds()

public ServingConfig.Builder clearReplacementControlIds()

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearSolutionTypes()

public ServingConfig.Builder clearSolutionTypes()

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clearTwowaySynonymsControlIds()

public ServingConfig.Builder clearTwowaySynonymsControlIds()

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

clone()

public ServingConfig.Builder clone()
Returns
Type Description
ServingConfig.Builder
Overrides

getBoostControlIds(int index)

public String getBoostControlIds(int index)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The boostControlIds at the given index.

getBoostControlIdsBytes(int index)

public ByteString getBoostControlIdsBytes(int index)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the boostControlIds at the given index.

getBoostControlIdsCount()

public int getBoostControlIdsCount()

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Returns
Type Description
int

The count of boostControlIds.

getBoostControlIdsList()

public ProtocolStringList getBoostControlIdsList()

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Returns
Type Description
ProtocolStringList

A list containing the boostControlIds.

getDefaultInstanceForType()

public ServingConfig getDefaultInstanceForType()
Returns
Type Description
ServingConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Required. The human readable serving config display name. Used in Retail UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The human readable serving config display name. Used in Retail UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getDiversityLevel()

public String getDiversityLevel()

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity

    If not specified, we choose default based on recommendation model type. Default value: no-diversity.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string diversity_level = 8;

Returns
Type Description
String

The diversityLevel.

getDiversityLevelBytes()

public ByteString getDiversityLevelBytes()

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity

    If not specified, we choose default based on recommendation model type. Default value: no-diversity.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string diversity_level = 8;

Returns
Type Description
ByteString

The bytes for diversityLevel.

getDiversityType()

public ServingConfig.DiversityType getDiversityType()

What kind of diversity to use - data driven or rule based. If unset, the server behavior defaults to RULE_BASED_DIVERSITY.

.google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20;

Returns
Type Description
ServingConfig.DiversityType

The diversityType.

getDiversityTypeValue()

public int getDiversityTypeValue()

What kind of diversity to use - data driven or rule based. If unset, the server behavior defaults to RULE_BASED_DIVERSITY.

.google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20;

Returns
Type Description
int

The enum numeric value on the wire for diversityType.

getDoNotAssociateControlIds(int index)

public String getDoNotAssociateControlIds(int index)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The doNotAssociateControlIds at the given index.

getDoNotAssociateControlIdsBytes(int index)

public ByteString getDoNotAssociateControlIdsBytes(int index)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the doNotAssociateControlIds at the given index.

getDoNotAssociateControlIdsCount()

public int getDoNotAssociateControlIdsCount()

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Returns
Type Description
int

The count of doNotAssociateControlIds.

getDoNotAssociateControlIdsList()

public ProtocolStringList getDoNotAssociateControlIdsList()

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Returns
Type Description
ProtocolStringList

A list containing the doNotAssociateControlIds.

getDynamicFacetSpec()

public SearchRequest.DynamicFacetSpec getDynamicFacetSpec()

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Returns
Type Description
SearchRequest.DynamicFacetSpec

The dynamicFacetSpec.

getDynamicFacetSpecBuilder()

public SearchRequest.DynamicFacetSpec.Builder getDynamicFacetSpecBuilder()

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Returns
Type Description
SearchRequest.DynamicFacetSpec.Builder

getDynamicFacetSpecOrBuilder()

public SearchRequest.DynamicFacetSpecOrBuilder getDynamicFacetSpecOrBuilder()

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Returns
Type Description
SearchRequest.DynamicFacetSpecOrBuilder

getEnableCategoryFilterLevel()

public String getEnableCategoryFilterLevel()

Whether to add additional category filters on the similar-items model. If not specified, we enable it by default. Allowed values are:

  • no-category-match: No additional filtering of original results from the model and the customer's filters.
  • relaxed-category-match: Only keep results with categories that match at least one item categories in the PredictRequests's context item.

    • If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match).

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string enable_category_filter_level = 16;

Returns
Type Description
String

The enableCategoryFilterLevel.

getEnableCategoryFilterLevelBytes()

public ByteString getEnableCategoryFilterLevelBytes()

Whether to add additional category filters on the similar-items model. If not specified, we enable it by default. Allowed values are:

  • no-category-match: No additional filtering of original results from the model and the customer's filters.
  • relaxed-category-match: Only keep results with categories that match at least one item categories in the PredictRequests's context item.

    • If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match).

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string enable_category_filter_level = 16;

Returns
Type Description
ByteString

The bytes for enableCategoryFilterLevel.

getFacetControlIds(int index)

public String getFacetControlIds(int index)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The facetControlIds at the given index.

getFacetControlIdsBytes(int index)

public ByteString getFacetControlIdsBytes(int index)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the facetControlIds at the given index.

getFacetControlIdsCount()

public int getFacetControlIdsCount()

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Returns
Type Description
int

The count of facetControlIds.

getFacetControlIdsList()

public ProtocolStringList getFacetControlIdsList()

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Returns
Type Description
ProtocolStringList

A list containing the facetControlIds.

getFilterControlIds(int index)

public String getFilterControlIds(int index)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The filterControlIds at the given index.

getFilterControlIdsBytes(int index)

public ByteString getFilterControlIdsBytes(int index)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the filterControlIds at the given index.

getFilterControlIdsCount()

public int getFilterControlIdsCount()

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Returns
Type Description
int

The count of filterControlIds.

getFilterControlIdsList()

public ProtocolStringList getFilterControlIdsList()

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Returns
Type Description
ProtocolStringList

A list containing the filterControlIds.

getIgnoreControlIds(int index)

public String getIgnoreControlIds(int index)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The ignoreControlIds at the given index.

getIgnoreControlIdsBytes(int index)

public ByteString getIgnoreControlIdsBytes(int index)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the ignoreControlIds at the given index.

getIgnoreControlIdsCount()

public int getIgnoreControlIdsCount()

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Returns
Type Description
int

The count of ignoreControlIds.

getIgnoreControlIdsList()

public ProtocolStringList getIgnoreControlIdsList()

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Returns
Type Description
ProtocolStringList

A list containing the ignoreControlIds.

getIgnoreRecsDenylist()

public boolean getIgnoreRecsDenylist()

When the flag is enabled, the products in the denylist will not be filtered out in the recommendation filtering results.

bool ignore_recs_denylist = 24;

Returns
Type Description
boolean

The ignoreRecsDenylist.

getModelId()

public String getModelId()

The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR).

Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.

string model_id = 3;

Returns
Type Description
String

The modelId.

getModelIdBytes()

public ByteString getModelIdBytes()

The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR).

Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.

string model_id = 3;

Returns
Type Description
ByteString

The bytes for modelId.

getName()

public String getName()

Immutable. Fully qualified name projects/*/locations/global/catalogs/*/servingConfig/*

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. Fully qualified name projects/*/locations/global/catalogs/*/servingConfig/*

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ByteString

The bytes for name.

getOnewaySynonymsControlIds(int index)

public String getOnewaySynonymsControlIds(int index)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The onewaySynonymsControlIds at the given index.

getOnewaySynonymsControlIdsBytes(int index)

public ByteString getOnewaySynonymsControlIdsBytes(int index)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the onewaySynonymsControlIds at the given index.

getOnewaySynonymsControlIdsCount()

public int getOnewaySynonymsControlIdsCount()

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Returns
Type Description
int

The count of onewaySynonymsControlIds.

getOnewaySynonymsControlIdsList()

public ProtocolStringList getOnewaySynonymsControlIdsList()

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Returns
Type Description
ProtocolStringList

A list containing the onewaySynonymsControlIds.

getPersonalizationSpec()

public SearchRequest.PersonalizationSpec getPersonalizationSpec()

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Returns
Type Description
SearchRequest.PersonalizationSpec

The personalizationSpec.

getPersonalizationSpecBuilder()

public SearchRequest.PersonalizationSpec.Builder getPersonalizationSpecBuilder()

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Returns
Type Description
SearchRequest.PersonalizationSpec.Builder

getPersonalizationSpecOrBuilder()

public SearchRequest.PersonalizationSpecOrBuilder getPersonalizationSpecOrBuilder()

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Returns
Type Description
SearchRequest.PersonalizationSpecOrBuilder

getPriceRerankingLevel()

public String getPriceRerankingLevel()

How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are:

  • no-price-reranking
  • low-price-reranking
  • medium-price-reranking
  • high-price-reranking

    If not specified, we choose default based on model type. Default value: no-price-reranking.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string price_reranking_level = 4;

Returns
Type Description
String

The priceRerankingLevel.

getPriceRerankingLevelBytes()

public ByteString getPriceRerankingLevelBytes()

How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are:

  • no-price-reranking
  • low-price-reranking
  • medium-price-reranking
  • high-price-reranking

    If not specified, we choose default based on model type. Default value: no-price-reranking.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string price_reranking_level = 4;

Returns
Type Description
ByteString

The bytes for priceRerankingLevel.

getRedirectControlIds(int index)

public String getRedirectControlIds(int index)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The redirectControlIds at the given index.

getRedirectControlIdsBytes(int index)

public ByteString getRedirectControlIdsBytes(int index)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the redirectControlIds at the given index.

getRedirectControlIdsCount()

public int getRedirectControlIdsCount()

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Returns
Type Description
int

The count of redirectControlIds.

getRedirectControlIdsList()

public ProtocolStringList getRedirectControlIdsList()

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Returns
Type Description
ProtocolStringList

A list containing the redirectControlIds.

getReplacementControlIds(int index)

public String getReplacementControlIds(int index)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The replacementControlIds at the given index.

getReplacementControlIdsBytes(int index)

public ByteString getReplacementControlIdsBytes(int index)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the replacementControlIds at the given index.

getReplacementControlIdsCount()

public int getReplacementControlIdsCount()

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Returns
Type Description
int

The count of replacementControlIds.

getReplacementControlIdsList()

public ProtocolStringList getReplacementControlIdsList()

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Returns
Type Description
ProtocolStringList

A list containing the replacementControlIds.

getSolutionTypes(int index)

public SolutionType getSolutionTypes(int index)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
SolutionType

The solutionTypes at the given index.

getSolutionTypesCount()

public int getSolutionTypesCount()

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
int

The count of solutionTypes.

getSolutionTypesList()

public List<SolutionType> getSolutionTypesList()

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
List<SolutionType>

A list containing the solutionTypes.

getSolutionTypesValue(int index)

public int getSolutionTypesValue(int index)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of solutionTypes at the given index.

getSolutionTypesValueList()

public List<Integer> getSolutionTypesValueList()

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for solutionTypes.

getTwowaySynonymsControlIds(int index)

public String getTwowaySynonymsControlIds(int index)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The twowaySynonymsControlIds at the given index.

getTwowaySynonymsControlIdsBytes(int index)

public ByteString getTwowaySynonymsControlIdsBytes(int index)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the twowaySynonymsControlIds at the given index.

getTwowaySynonymsControlIdsCount()

public int getTwowaySynonymsControlIdsCount()

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Returns
Type Description
int

The count of twowaySynonymsControlIds.

getTwowaySynonymsControlIdsList()

public ProtocolStringList getTwowaySynonymsControlIdsList()

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Returns
Type Description
ProtocolStringList

A list containing the twowaySynonymsControlIds.

hasDynamicFacetSpec()

public boolean hasDynamicFacetSpec()

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Returns
Type Description
boolean

Whether the dynamicFacetSpec field is set.

hasPersonalizationSpec()

public boolean hasPersonalizationSpec()

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Returns
Type Description
boolean

Whether the personalizationSpec field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDynamicFacetSpec(SearchRequest.DynamicFacetSpec value)

public ServingConfig.Builder mergeDynamicFacetSpec(SearchRequest.DynamicFacetSpec value)

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Parameter
Name Description
value SearchRequest.DynamicFacetSpec
Returns
Type Description
ServingConfig.Builder

mergeFrom(ServingConfig other)

public ServingConfig.Builder mergeFrom(ServingConfig other)
Parameter
Name Description
other ServingConfig
Returns
Type Description
ServingConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ServingConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ServingConfig.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ServingConfig.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ServingConfig.Builder
Overrides

mergePersonalizationSpec(SearchRequest.PersonalizationSpec value)

public ServingConfig.Builder mergePersonalizationSpec(SearchRequest.PersonalizationSpec value)

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Parameter
Name Description
value SearchRequest.PersonalizationSpec
Returns
Type Description
ServingConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ServingConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ServingConfig.Builder
Overrides

setBoostControlIds(int index, String value)

public ServingConfig.Builder setBoostControlIds(int index, String value)

Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100.

Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string boost_control_ids = 7;

Parameters
Name Description
index int

The index to set the value at.

value String

The boostControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDisplayName(String value)

public ServingConfig.Builder setDisplayName(String value)

Required. The human readable serving config display name. Used in Retail UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public ServingConfig.Builder setDisplayNameBytes(ByteString value)

Required. The human readable serving config display name. Used in Retail UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDiversityLevel(String value)

public ServingConfig.Builder setDiversityLevel(String value)

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity

    If not specified, we choose default based on recommendation model type. Default value: no-diversity.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string diversity_level = 8;

Parameter
Name Description
value String

The diversityLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDiversityLevelBytes(ByteString value)

public ServingConfig.Builder setDiversityLevelBytes(ByteString value)

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity

    If not specified, we choose default based on recommendation model type. Default value: no-diversity.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string diversity_level = 8;

Parameter
Name Description
value ByteString

The bytes for diversityLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDiversityType(ServingConfig.DiversityType value)

public ServingConfig.Builder setDiversityType(ServingConfig.DiversityType value)

What kind of diversity to use - data driven or rule based. If unset, the server behavior defaults to RULE_BASED_DIVERSITY.

.google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20;

Parameter
Name Description
value ServingConfig.DiversityType

The diversityType to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDiversityTypeValue(int value)

public ServingConfig.Builder setDiversityTypeValue(int value)

What kind of diversity to use - data driven or rule based. If unset, the server behavior defaults to RULE_BASED_DIVERSITY.

.google.cloud.retail.v2.ServingConfig.DiversityType diversity_type = 20;

Parameter
Name Description
value int

The enum numeric value on the wire for diversityType to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDoNotAssociateControlIds(int index, String value)

public ServingConfig.Builder setDoNotAssociateControlIds(int index, String value)

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string do_not_associate_control_ids = 13;

Parameters
Name Description
index int

The index to set the value at.

value String

The doNotAssociateControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setDynamicFacetSpec(SearchRequest.DynamicFacetSpec value)

public ServingConfig.Builder setDynamicFacetSpec(SearchRequest.DynamicFacetSpec value)

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Parameter
Name Description
value SearchRequest.DynamicFacetSpec
Returns
Type Description
ServingConfig.Builder

setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.Builder builderForValue)

public ServingConfig.Builder setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.Builder builderForValue)

The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;

Parameter
Name Description
builderForValue SearchRequest.DynamicFacetSpec.Builder
Returns
Type Description
ServingConfig.Builder

setEnableCategoryFilterLevel(String value)

public ServingConfig.Builder setEnableCategoryFilterLevel(String value)

Whether to add additional category filters on the similar-items model. If not specified, we enable it by default. Allowed values are:

  • no-category-match: No additional filtering of original results from the model and the customer's filters.
  • relaxed-category-match: Only keep results with categories that match at least one item categories in the PredictRequests's context item.

    • If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match).

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string enable_category_filter_level = 16;

Parameter
Name Description
value String

The enableCategoryFilterLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setEnableCategoryFilterLevelBytes(ByteString value)

public ServingConfig.Builder setEnableCategoryFilterLevelBytes(ByteString value)

Whether to add additional category filters on the similar-items model. If not specified, we enable it by default. Allowed values are:

  • no-category-match: No additional filtering of original results from the model and the customer's filters.
  • relaxed-category-match: Only keep results with categories that match at least one item categories in the PredictRequests's context item.

    • If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match).

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string enable_category_filter_level = 16;

Parameter
Name Description
value ByteString

The bytes for enableCategoryFilterLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setFacetControlIds(int index, String value)

public ServingConfig.Builder setFacetControlIds(int index, String value)

Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string facet_control_ids = 5;

Parameters
Name Description
index int

The index to set the value at.

value String

The facetControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ServingConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ServingConfig.Builder
Overrides

setFilterControlIds(int index, String value)

public ServingConfig.Builder setFilterControlIds(int index, String value)

Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string filter_control_ids = 9;

Parameters
Name Description
index int

The index to set the value at.

value String

The filterControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setIgnoreControlIds(int index, String value)

public ServingConfig.Builder setIgnoreControlIds(int index, String value)

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

  • Order does not matter.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string ignore_control_ids = 15;

Parameters
Name Description
index int

The index to set the value at.

value String

The ignoreControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setIgnoreRecsDenylist(boolean value)

public ServingConfig.Builder setIgnoreRecsDenylist(boolean value)

When the flag is enabled, the products in the denylist will not be filtered out in the recommendation filtering results.

bool ignore_recs_denylist = 24;

Parameter
Name Description
value boolean

The ignoreRecsDenylist to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setModelId(String value)

public ServingConfig.Builder setModelId(String value)

The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR).

Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.

string model_id = 3;

Parameter
Name Description
value String

The modelId to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setModelIdBytes(ByteString value)

public ServingConfig.Builder setModelIdBytes(ByteString value)

The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR).

Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.

string model_id = 3;

Parameter
Name Description
value ByteString

The bytes for modelId to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setName(String value)

public ServingConfig.Builder setName(String value)

Immutable. Fully qualified name projects/*/locations/global/catalogs/*/servingConfig/*

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setNameBytes(ByteString value)

public ServingConfig.Builder setNameBytes(ByteString value)

Immutable. Fully qualified name projects/*/locations/global/catalogs/*/servingConfig/*

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setOnewaySynonymsControlIds(int index, String value)

public ServingConfig.Builder setOnewaySynonymsControlIds(int index, String value)

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string oneway_synonyms_control_ids = 12;

Parameters
Name Description
index int

The index to set the value at.

value String

The onewaySynonymsControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setPersonalizationSpec(SearchRequest.PersonalizationSpec value)

public ServingConfig.Builder setPersonalizationSpec(SearchRequest.PersonalizationSpec value)

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Parameter
Name Description
value SearchRequest.PersonalizationSpec
Returns
Type Description
ServingConfig.Builder

setPersonalizationSpec(SearchRequest.PersonalizationSpec.Builder builderForValue)

public ServingConfig.Builder setPersonalizationSpec(SearchRequest.PersonalizationSpec.Builder builderForValue)

The specification for personalization spec.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec.

.google.cloud.retail.v2.SearchRequest.PersonalizationSpec personalization_spec = 21;

Parameter
Name Description
builderForValue SearchRequest.PersonalizationSpec.Builder
Returns
Type Description
ServingConfig.Builder

setPriceRerankingLevel(String value)

public ServingConfig.Builder setPriceRerankingLevel(String value)

How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are:

  • no-price-reranking
  • low-price-reranking
  • medium-price-reranking
  • high-price-reranking

    If not specified, we choose default based on model type. Default value: no-price-reranking.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string price_reranking_level = 4;

Parameter
Name Description
value String

The priceRerankingLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setPriceRerankingLevelBytes(ByteString value)

public ServingConfig.Builder setPriceRerankingLevelBytes(ByteString value)

How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are:

  • no-price-reranking
  • low-price-reranking
  • medium-price-reranking
  • high-price-reranking

    If not specified, we choose default based on model type. Default value: no-price-reranking.

    Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.

string price_reranking_level = 4;

Parameter
Name Description
value ByteString

The bytes for priceRerankingLevel to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setRedirectControlIds(int index, String value)

public ServingConfig.Builder setRedirectControlIds(int index, String value)

Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string redirect_control_ids = 10;

Parameters
Name Description
index int

The index to set the value at.

value String

The redirectControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ServingConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ServingConfig.Builder
Overrides

setReplacementControlIds(int index, String value)

public ServingConfig.Builder setReplacementControlIds(int index, String value)

Condition replacement specifications.

  • Applied according to the order in the list.
  • A previously replaced term can not be re-replaced.
  • Maximum number of specifications is 100.

    Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string replacement_control_ids = 14;

Parameters
Name Description
index int

The index to set the value at.

value String

The replacementControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setSolutionTypes(int index, SolutionType value)

public ServingConfig.Builder setSolutionTypes(int index, SolutionType value)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameters
Name Description
index int

The index to set the value at.

value SolutionType

The solutionTypes to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setSolutionTypesValue(int index, int value)

public ServingConfig.Builder setSolutionTypesValue(int index, int value)

Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.

repeated .google.cloud.retail.v2.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Parameters
Name Description
index int

The index to set the value at.

value int

The enum numeric value on the wire for solutionTypes to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setTwowaySynonymsControlIds(int index, String value)

public ServingConfig.Builder setTwowaySynonymsControlIds(int index, String value)

Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100.

Can only be set if solution_types is SOLUTION_TYPE_SEARCH.

repeated string twoway_synonyms_control_ids = 18;

Parameters
Name Description
index int

The index to set the value at.

value String

The twowaySynonymsControlIds to set.

Returns
Type Description
ServingConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ServingConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ServingConfig.Builder
Overrides