Create serving controls

This page describes how to create serving controls.

Serving controls are rules that you define and apply to individual serving configs.

You can create a serving control in the AI Commerce Search in Gemini Enterprise for Customer Experience console consisting of a condition, which triggers the control, and an action that takes place when the condition triggers. You can then attach the new serving control to a serving configuration.

Relationship between serving controls and configs

Serving configs have a multi-to-multi relationship with controls. You can add multiple controls to a serving config, and a single control can be associated with multiple serving configs.

When you create serving controls and serving configs, you select a product (recommendations or search) that the control can be used for.

Serving controls can be associated only with serving configs of the same product type. For example, a serving control created for recommendations can't be associated with a serving config that was created for search.

Serving configurations

Serving configs manage which controls are applied during a search or prediction request. Only the controls on the active serving config for a request are considered at serving time. For example, suppose you have created two controls: a control called gShoe Sale that boosts results for the brand gShoe when shoes is searched for and a control called More shoes that expands queries using the term running shoes to include sport shoes. If you attach only the gShoe Sale control to a serving config, then search requests using that serving config boosts gShoe results for queries using the term shoes, but the More shoes control has no effect because it is not attached to the serving config you are using.

For more information, refer to About serving configs.

Quickstart videos and guides

  • Introduction to serving controls: Serving controls enable you to create rules that customize how your serving configurations return search results.
  • Boost/bury: Affects result ranking and order in the returned result list. Available for search and recommendations.
  • Filter: Removes results that do not pass the filter from the returned result list. Available for search only.
  • Redirect: Redirects your users to a specific page depending on the search query. Available for search only.

This tutorial shows you to how to use the redirect control.


To follow step-by-step guidance for this task directly in the Cloud Shell Editor, click Guide me:

Guide me


  • Linguistic: Customizes search query linguistics. Available for search only.
    Several types of linguistic controls are available:
    • Synonym: Expands considered synonyms for a search query.
    • One-way synonym: Expands considered synonyms unidirectionally for specific terms.
    • Do not associate: Prevent a group of terms from being used in search when specific terms appear.
    • Ignore: Prevent a term from being used in searches.
    • Replacement: Replaces terms in the search query.
  • Pinning: Affects result ordering, placing a result at a specific position — for example, at position 4. Available for search and browse.

For examples of these controls, see About serving controls.

Serving control configuration options

You can create controls and then add or swap them into a live serving configuration.

You can create up to 100 serving controls in AI Commerce Search. If you need more serving controls, request additional quota. To do so, follow the steps in Increase your quotas.

A serving config can have up to 100 serving controls of any type, with the exception of search redirect controls, whose limit can be up to 1,000 per serving config. Keep in mind that your quota for controls on one serving config may differ from the overall quota allowed for a control type in your AI Commerce Search API.

You can create a serving control in these ways:

To use the Google Cloud console to create serving controls:

  1. Go to the Controls page in the AI Commerce Search in Gemini Enterprise for Customer Experience console.

    Go to the Controls page

  2. Follow the Google Cloud console steps under each serving control section.

Control types

Controls have different requirements depending on their type. Go to the creation procedure for the control type you plan to create:

Create a boost/bury control

This control type is available for search and recommendations.

See Boost/bury controls for more about this control type.

To create a search boost/bury control:

Cloud console

  1. Go to the Controls page in the AI Commerce Search in Gemini Enterprise for Customer Experience console.

    Go to the Controls page

  2. Under the Serving controls tab, click Create control.

    The Create control pane opens.

  3. In the Preferences section, in the Control name field, enter a name for your new control.

  4. Optional: To change the automatically created control ID, click Edit and enter a new control ID.

  5. In the Product selection section, select Search.

  6. Choose Boost/bury controls as the control type. Click Continue

  7. In the Triggers section, select what type of user behavior triggers this control.

    • Browse categories: The rule is triggered when a user browses categories on your site (search.request.query is empty).

    • Search: The rule is triggered when a user searches on your site (search.request.query isn't empty). To set this control to trigger when any category is browsed, or any query is searched for, skip the following step.

  8. Optional: Set specific categories or queries that can trigger this control depending on whether a specific category is browsed or a specific query is searched for.

    • If you chose Browse categories: In the Categories field, enter which categories will trigger this control when browsed.

    • If you chose Search: Click the Add query button to add query terms (for example, running shoes) to be filtered. For each term, choose either Partial match or Full match.

  9. Optional: Click the Add Time Range button to add one or more time ranges during which this control can be applied.

  10. Click Continue to proceed to the Actions section.

  11. Add filters for product attributes in the Boost/bury product field.

    Use the filter expression syntax documented in Filtering and ordering. For example, to specify red and blue versions of "product1" and "product2": (id: ANY("product1","product2")) AND (colorFamily: ANY("Red","Blue"))

  12. For Boost/bury value, use the slider to set the strength of the boost. Positive values boost the results, and negative values bury them. Click Continue.

  13. In the Serving configs section, select which serving configs to apply the control to.

  14. Submit your control settings.

    It takes a few minutes for newly created or updated controls to be ready to serve live traffic. You can test if your changes have been applied on the console Evaluate page.

You can now find the new control listed on the Serving controls tab of the Controls page.

curl

Make a Control.create request with a control ID and an instance of Control contained in the request body.

For field details, see the Controls API reference and the