Provide support for multiple servingConfigName options

Created on 28 August 2024, 4 months ago

Problem/Motivation

When creating a search request, the Serving Config must be set:

$request = (new SearchRequest())->setServingConfig($formattedServingConfig);

Currently, (version 0.8.0 of the discovery-engine library) the $formattedServingConfig string that represents the resource against which to search is created using the 'servingConfigName' static function of the SearchServiceClient:

$formattedServingConfig = SearchServiceClient::servingConfigName(
      $this->configuration['google_cloud_project_id'],
      $this->configuration['google_cloud_location'],
      $this->configuration['vertex_ai_data_store_id'],
      $this->configuration['vertex_ai_serving_config']
    );

The shortcoming of using the 'servingConfigName' function is that it requires the datastore to be specified; all search requests will be performed against that specific datastore resource. This may not always be desired as search apps now support blended search and can use multiple datastores.

With the 1.0.0 version of the google/cloud-discoveryengine library, there are other functions available for creating the $formattedServingConfig string that represents the resource against which to search:

  • static::projectLocationCollectionDataStoreServingConfigName
  • static::projectLocationCollectionEngineServingConfigName
  • static::projectLocationDataStoreServingConfigName
  • static::servingConfigName

The 'projectLocationCollectionEngineServingConfigName' can be used to specify a specific search app (Engine) to use without having to indicate a specific, single datastore.

Support for all of these options for creating the resource string should be available.

Read about Serving Configs.

  • For search apps, the default serving config's ID is default_search
  • search and generic recommendations apps don't allow you to modify serving configs or create additional serving configs
  • 'Engine' refers to the search app id
  • 'Collection' will be 'default_collection' for search apps.

Proposed resolution

-

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tzura

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024