You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gem name and version: google-cloud-discovery_engine-v1 (0.8.0)
Code example
# document: https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/0.1.0require'google/cloud/discovery_engine/v1'classVertexAIRepositoryclass << selfdefsearch_event_ids(search_query:)client=initialize_search_clientrequest=build_search_request(search_query:)fetch_event_ids_from_vertex_ai(client:,request:)endprivatedefinitialize_search_clientservice_account_creds=ENV.fetch('GOOGLE_CLOUD_CREDENTIALS')beginsecret_data=JSON.parse(service_account_creds)rescueJSON::ParserError=>eraise"Error parsing JSON secret string: #{e.message}"endGoogle::Cloud::DiscoveryEngine::V1::DocumentService::Client.configuredo |config|
config.credentials=Google::Auth::Credentials.new(secret_data)endGoogle::Cloud::DiscoveryEngine::V1::SearchService::Client.newenddefbuild_search_request(search_query:)gcp_project_id=ENV.fetch('GOOGLE_CLOUD_PROJECT_ID')vertex_ai_engine_id=ENV.fetch('VERTEX_AI_ENGINE_ID')serving_config="projects/#{gcp_project_id}/locations/global/collections/default_collection/engines/#{vertex_ai_engine_id}/servingConfigs/default_config"content_search_spec=Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec.new(snippet_spec: Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SnippetSpec.new# NOTE: summary spec is not currently supproted for Ruby sdk.)# Create a request. To set request fields, pass in keyword arguments.Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config:,query: search_query,page_size: 10,content_search_spec: # error raises here.)enddeffetch_event_ids_from_vertex_ai(client:,request:)event_ids=[]beginresult=client.searchrequestresult.eachdo |item|
event_ids.push(item.to_h[:id])endevent_idsrescueGoogle::Cloud::Error=>eRails.logger.errore.messageSentry.capture_message(e.message)endevent_idsendendend
Error message:
3:ContentSearchSpec can only be set in a SearchRequest searching against content search enabled DataStore.. debug_error_string:{UNKNOWN:Error received from peer ipv4:xxx.xxx.xxx.xxx {created_time:"2024-06-03T09:15:34.59707936+00:00", grpc_status:3, grpc_message:"ContentSearchSpec can only be set in a SearchRequest searching against content search enabled DataStore."}}
This error started occurring on 5/31. I assume that the release on 5/31 may be related to this error but I could not find out some changes around ContentSearchSpec module.
When I stopped using ContentSearchSpec, the error has gone.
Is this a bug or there were some breaking changes in sdk?
The text was updated successfully, but these errors were encountered:
Hello. I had answer from GCP support. In my case, it's due to I used ContentSearchSpec on structured data store. ContentSearchSpec is only ruanable on unstructured datastore. Hope it can help you !
Environment details
google-cloud-discovery_engine-v1 (0.8.0)
Code example
Error message:
This error started occurring on 5/31. I assume that the release on 5/31 may be related to this error but I could not find out some changes around
ContentSearchSpec
module.When I stopped using
ContentSearchSpec
, the error has gone.Is this a bug or there were some breaking changes in sdk?
The text was updated successfully, but these errors were encountered: