google-cloud-discovery_engine-v1 1.1.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +6 -6
- data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +6 -6
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +15 -12
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +15 -12
- data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/document_service/paths.rb +25 -0
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +219 -3
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +85 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +126 -3
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +60 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +324 -1
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +316 -1
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +76 -0
- data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +5 -1
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +5 -1
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/control_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +23 -1
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +4 -0
- data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +5 -1
- data/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb +14 -0
- data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +18 -2
- data/proto_docs/google/cloud/discoveryengine/v1/control.rb +9 -0
- data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +6 -6
- data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +59 -15
- data/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb +8 -3
- data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +88 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +7 -5
- data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +19 -0
- data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +5 -1
- data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +383 -0
- data/proto_docs/google/cloud/discoveryengine/v1/project.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +116 -0
- data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +5 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +1 -1
- metadata +3 -3
@@ -196,7 +196,7 @@ module Google
|
|
196
196
|
# @param options [::Gapic::CallOptions, ::Hash]
|
197
197
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
198
198
|
#
|
199
|
-
# @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, session: nil, session_spec: nil)
|
199
|
+
# @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, session: nil, session_spec: nil)
|
200
200
|
# Pass arguments to `search` via keyword arguments. Note that at
|
201
201
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
202
202
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -246,6 +246,10 @@ module Google
|
|
246
246
|
# unset.
|
247
247
|
#
|
248
248
|
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
249
|
+
# @param one_box_page_size [::Integer]
|
250
|
+
# The maximum number of results to return for OneBox.
|
251
|
+
# This applies to each OneBox type individually.
|
252
|
+
# Default number is 10.
|
249
253
|
# @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>]
|
250
254
|
# Specs defining dataStores to filter on in a search call and configurations
|
251
255
|
# for those dataStores. This is only considered for engines with multiple
|
@@ -479,6 +483,318 @@ module Google
|
|
479
483
|
raise ::Google::Cloud::Error.from_error(e)
|
480
484
|
end
|
481
485
|
|
486
|
+
##
|
487
|
+
# Performs a search. Similar to the
|
488
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
|
489
|
+
# method, but a lite version that allows API key for authentication, where
|
490
|
+
# OAuth and IAM checks are not required.
|
491
|
+
#
|
492
|
+
# Only public website search is supported by this method. If data stores and
|
493
|
+
# engines not associated with public website search are specified, a
|
494
|
+
# `FAILED_PRECONDITION` error is returned.
|
495
|
+
#
|
496
|
+
# This method can be used for easy onboarding without having to implement an
|
497
|
+
# authentication backend. However, it is strongly recommended to use
|
498
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
|
499
|
+
# instead with required OAuth and IAM checks to provide better data security.
|
500
|
+
#
|
501
|
+
# @overload search_lite(request, options = nil)
|
502
|
+
# Pass arguments to `search_lite` via a request object, either of type
|
503
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash.
|
504
|
+
#
|
505
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash]
|
506
|
+
# A request object representing the call parameters. Required. To specify no
|
507
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
508
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
509
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
510
|
+
#
|
511
|
+
# @overload search_lite(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, session: nil, session_spec: nil)
|
512
|
+
# Pass arguments to `search_lite` via keyword arguments. Note that at
|
513
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
514
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
515
|
+
#
|
516
|
+
# @param serving_config [::String]
|
517
|
+
# Required. The resource name of the Search serving config, such as
|
518
|
+
# `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
|
519
|
+
# or
|
520
|
+
# `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
|
521
|
+
# This field is used to identify the serving configuration name, set
|
522
|
+
# of models used to make the search.
|
523
|
+
# @param branch [::String]
|
524
|
+
# The branch resource name, such as
|
525
|
+
# `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
|
526
|
+
#
|
527
|
+
# Use `default_branch` as the branch ID or leave this field empty, to search
|
528
|
+
# documents under the default branch.
|
529
|
+
# @param query [::String]
|
530
|
+
# Raw search query.
|
531
|
+
# @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash]
|
532
|
+
# Raw image query.
|
533
|
+
# @param page_size [::Integer]
|
534
|
+
# Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to
|
535
|
+
# return. The maximum allowed value depends on the data type. Values above
|
536
|
+
# the maximum value are coerced to the maximum value.
|
537
|
+
#
|
538
|
+
# * Websites with basic indexing: Default `10`, Maximum `25`.
|
539
|
+
# * Websites with advanced indexing: Default `25`, Maximum `50`.
|
540
|
+
# * Other: Default `50`, Maximum `100`.
|
541
|
+
#
|
542
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
543
|
+
# @param page_token [::String]
|
544
|
+
# A page token received from a previous
|
545
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
|
546
|
+
# call. Provide this to retrieve the subsequent page.
|
547
|
+
#
|
548
|
+
# When paginating, all other parameters provided to
|
549
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
|
550
|
+
# must match the call that provided the page token. Otherwise, an
|
551
|
+
# `INVALID_ARGUMENT` error is returned.
|
552
|
+
# @param offset [::Integer]
|
553
|
+
# A 0-indexed integer that specifies the current offset (that is, starting
|
554
|
+
# result location, amongst the
|
555
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as
|
556
|
+
# relevant) in search results. This field is only considered if
|
557
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is
|
558
|
+
# unset.
|
559
|
+
#
|
560
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
561
|
+
# @param one_box_page_size [::Integer]
|
562
|
+
# The maximum number of results to return for OneBox.
|
563
|
+
# This applies to each OneBox type individually.
|
564
|
+
# Default number is 10.
|
565
|
+
# @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>]
|
566
|
+
# Specs defining dataStores to filter on in a search call and configurations
|
567
|
+
# for those dataStores. This is only considered for engines with multiple
|
568
|
+
# dataStores use case. For single dataStore within an engine, they should
|
569
|
+
# use the specs at the top level.
|
570
|
+
# @param filter [::String]
|
571
|
+
# The filter syntax consists of an expression language for constructing a
|
572
|
+
# predicate from one or more fields of the documents being filtered. Filter
|
573
|
+
# expression is case-sensitive.
|
574
|
+
#
|
575
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
576
|
+
#
|
577
|
+
# Filtering in Vertex AI Search is done by mapping the LHS filter key to a
|
578
|
+
# key property defined in the Vertex AI Search backend -- this mapping is
|
579
|
+
# defined by the customer in their schema. For example a media customer might
|
580
|
+
# have a field 'name' in their schema. In this case the filter would look
|
581
|
+
# like this: filter --> name:'ANY("king kong")'
|
582
|
+
#
|
583
|
+
# For more information about filtering including syntax and filter
|
584
|
+
# operators, see
|
585
|
+
# [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
|
586
|
+
# @param canonical_filter [::String]
|
587
|
+
# The default filter that is applied when a user performs a search without
|
588
|
+
# checking any filters on the search page.
|
589
|
+
#
|
590
|
+
# The filter applied to every search request when quality improvement such as
|
591
|
+
# query expansion is needed. In the case a query does not have a sufficient
|
592
|
+
# amount of results this filter will be used to determine whether or not to
|
593
|
+
# enable the query expansion flow. The original filter will still be used for
|
594
|
+
# the query expanded search.
|
595
|
+
# This field is strongly recommended to achieve high search quality.
|
596
|
+
#
|
597
|
+
# For more information about filter syntax, see
|
598
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}.
|
599
|
+
# @param order_by [::String]
|
600
|
+
# The order in which documents are returned. Documents can be ordered by
|
601
|
+
# a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object.
|
602
|
+
# Leave it unset if ordered by relevance. `order_by` expression is
|
603
|
+
# case-sensitive.
|
604
|
+
#
|
605
|
+
# For more information on ordering the website search results, see
|
606
|
+
# [Order web search
|
607
|
+
# results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results).
|
608
|
+
# For more information on ordering the healthcare search results, see
|
609
|
+
# [Order healthcare search
|
610
|
+
# results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results).
|
611
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
612
|
+
# @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash]
|
613
|
+
# Information about the end user.
|
614
|
+
# Highly recommended for analytics.
|
615
|
+
# {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent}
|
616
|
+
# is used to deduce `device_type` for analytics.
|
617
|
+
# @param language_code [::String]
|
618
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
619
|
+
# information, see [Standard
|
620
|
+
# fields](https://cloud.google.com/apis/design/standard_fields). This field
|
621
|
+
# helps to better interpret the query. If a value isn't specified, the query
|
622
|
+
# language code is automatically detected, which may not be accurate.
|
623
|
+
# @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>]
|
624
|
+
# Facet specifications for faceted search. If empty, no facets are returned.
|
625
|
+
#
|
626
|
+
# A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
|
627
|
+
# error is returned.
|
628
|
+
# @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash]
|
629
|
+
# Boost specification to boost certain documents.
|
630
|
+
# For more information on boosting, see
|
631
|
+
# [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
|
632
|
+
# @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}]
|
633
|
+
# Additional search parameters.
|
634
|
+
#
|
635
|
+
# For public website search only, supported values are:
|
636
|
+
#
|
637
|
+
# * `user_country_code`: string. Default empty. If set to non-empty, results
|
638
|
+
# are restricted or boosted based on the location provided.
|
639
|
+
# For example, `user_country_code: "au"`
|
640
|
+
#
|
641
|
+
# For available codes see [Country
|
642
|
+
# Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes)
|
643
|
+
#
|
644
|
+
# * `search_type`: double. Default empty. Enables non-webpage searching
|
645
|
+
# depending on the value. The only valid non-default value is 1,
|
646
|
+
# which enables image searching.
|
647
|
+
# For example, `search_type: 1`
|
648
|
+
# @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash]
|
649
|
+
# The query expansion specification that specifies the conditions under which
|
650
|
+
# query expansion occurs.
|
651
|
+
# @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash]
|
652
|
+
# The spell correction specification that specifies the mode under
|
653
|
+
# which spell correction takes effect.
|
654
|
+
# @param user_pseudo_id [::String]
|
655
|
+
# A unique identifier for tracking visitors. For example, this could be
|
656
|
+
# implemented with an HTTP cookie, which should be able to uniquely identify
|
657
|
+
# a visitor on a single device. This unique identifier should not change if
|
658
|
+
# the visitor logs in or out of the website.
|
659
|
+
#
|
660
|
+
# This field should NOT have a fixed value such as `unknown_visitor`.
|
661
|
+
#
|
662
|
+
# This should be the same identifier as
|
663
|
+
# {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id}
|
664
|
+
# and
|
665
|
+
# {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id CompleteQueryRequest.user_pseudo_id}
|
666
|
+
#
|
667
|
+
# The field must be a UTF-8 encoded string with a length limit of 128
|
668
|
+
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
669
|
+
# @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash]
|
670
|
+
# A specification for configuring the behavior of content search.
|
671
|
+
# @param safe_search [::Boolean]
|
672
|
+
# Whether to turn on safe search. This is only supported for
|
673
|
+
# website search.
|
674
|
+
# @param user_labels [::Hash{::String => ::String}]
|
675
|
+
# The user labels applied to a resource must meet the following requirements:
|
676
|
+
#
|
677
|
+
# * Each resource can have multiple labels, up to a maximum of 64.
|
678
|
+
# * Each label must be a key-value pair.
|
679
|
+
# * Keys have a minimum length of 1 character and a maximum length of 63
|
680
|
+
# characters and cannot be empty. Values can be empty and have a maximum
|
681
|
+
# length of 63 characters.
|
682
|
+
# * Keys and values can contain only lowercase letters, numeric characters,
|
683
|
+
# underscores, and dashes. All characters must use UTF-8 encoding, and
|
684
|
+
# international characters are allowed.
|
685
|
+
# * The key portion of a label must be unique. However, you can use the same
|
686
|
+
# key with multiple resources.
|
687
|
+
# * Keys must start with a lowercase letter or international character.
|
688
|
+
#
|
689
|
+
# See [Google Cloud
|
690
|
+
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
691
|
+
# for more details.
|
692
|
+
# @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash]
|
693
|
+
# Search as you type configuration. Only supported for the
|
694
|
+
# {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA}
|
695
|
+
# vertical.
|
696
|
+
# @param session [::String]
|
697
|
+
# The session resource name. Optional.
|
698
|
+
#
|
699
|
+
# Session allows users to do multi-turn /search API calls or coordination
|
700
|
+
# between /search API calls and /answer API calls.
|
701
|
+
#
|
702
|
+
# Example #1 (multi-turn /search API calls):
|
703
|
+
# 1. Call /search API with the auto-session mode (see below).
|
704
|
+
# 2. Call /search API with the session ID generated in the first call.
|
705
|
+
# Here, the previous search query gets considered in query
|
706
|
+
# standing. I.e., if the first query is "How did Alphabet do in 2022?"
|
707
|
+
# and the current query is "How about 2023?", the current query will
|
708
|
+
# be interpreted as "How did Alphabet do in 2023?".
|
709
|
+
#
|
710
|
+
# Example #2 (coordination between /search API calls and /answer API calls):
|
711
|
+
# 1. Call /search API with the auto-session mode (see below).
|
712
|
+
# 2. Call /answer API with the session ID generated in the first call.
|
713
|
+
# Here, the answer generation happens in the context of the search
|
714
|
+
# results from the first search call.
|
715
|
+
#
|
716
|
+
# Auto-session mode: when `projects/.../sessions/-` is used, a new session
|
717
|
+
# gets automatically created. Otherwise, users can use the create-session API
|
718
|
+
# to create a session manually.
|
719
|
+
#
|
720
|
+
# Multi-turn Search feature is currently at private GA stage. Please use
|
721
|
+
# v1alpha or v1beta version instead before we launch this feature to public
|
722
|
+
# GA. Or ask for allowlisting through Google Support team.
|
723
|
+
# @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash]
|
724
|
+
# Session specification.
|
725
|
+
#
|
726
|
+
# Can be used only when `session` is set.
|
727
|
+
#
|
728
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
729
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
|
730
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
731
|
+
#
|
732
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
|
733
|
+
#
|
734
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
735
|
+
#
|
736
|
+
# @example Basic example
|
737
|
+
# require "google/cloud/discovery_engine/v1"
|
738
|
+
#
|
739
|
+
# # Create a client object. The client can be reused for multiple calls.
|
740
|
+
# client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new
|
741
|
+
#
|
742
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
743
|
+
# request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new
|
744
|
+
#
|
745
|
+
# # Call the search_lite method.
|
746
|
+
# result = client.search_lite request
|
747
|
+
#
|
748
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
749
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
750
|
+
# result.each do |item|
|
751
|
+
# # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult.
|
752
|
+
# p item
|
753
|
+
# end
|
754
|
+
#
|
755
|
+
def search_lite request, options = nil
|
756
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
757
|
+
|
758
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest
|
759
|
+
|
760
|
+
# Converts hash and nil to an options object
|
761
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
762
|
+
|
763
|
+
# Customize the options with defaults
|
764
|
+
metadata = @config.rpcs.search_lite.metadata.to_h
|
765
|
+
|
766
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
767
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
768
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
769
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
770
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
771
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
772
|
+
|
773
|
+
header_params = {}
|
774
|
+
if request.serving_config
|
775
|
+
header_params["serving_config"] = request.serving_config
|
776
|
+
end
|
777
|
+
|
778
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
779
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
780
|
+
|
781
|
+
options.apply_defaults timeout: @config.rpcs.search_lite.timeout,
|
782
|
+
metadata: metadata,
|
783
|
+
retry_policy: @config.rpcs.search_lite.retry_policy
|
784
|
+
|
785
|
+
options.apply_defaults timeout: @config.timeout,
|
786
|
+
metadata: @config.metadata,
|
787
|
+
retry_policy: @config.retry_policy
|
788
|
+
|
789
|
+
@search_service_stub.call_rpc :search_lite, request, options: options do |response, operation|
|
790
|
+
response = ::Gapic::PagedEnumerable.new @search_service_stub, :search_lite, request, response, operation, options
|
791
|
+
yield response, operation if block_given?
|
792
|
+
return response
|
793
|
+
end
|
794
|
+
rescue ::GRPC::BadStatus => e
|
795
|
+
raise ::Google::Cloud::Error.from_error(e)
|
796
|
+
end
|
797
|
+
|
482
798
|
##
|
483
799
|
# Configuration class for the SearchService API.
|
484
800
|
#
|
@@ -637,11 +953,18 @@ module Google
|
|
637
953
|
# @return [::Gapic::Config::Method]
|
638
954
|
#
|
639
955
|
attr_reader :search
|
956
|
+
##
|
957
|
+
# RPC-specific configuration for `search_lite`
|
958
|
+
# @return [::Gapic::Config::Method]
|
959
|
+
#
|
960
|
+
attr_reader :search_lite
|
640
961
|
|
641
962
|
# @private
|
642
963
|
def initialize parent_rpcs = nil
|
643
964
|
search_config = parent_rpcs.search if parent_rpcs.respond_to? :search
|
644
965
|
@search = ::Gapic::Config::Method.new search_config
|
966
|
+
search_lite_config = parent_rpcs.search_lite if parent_rpcs.respond_to? :search_lite
|
967
|
+
@search_lite = ::Gapic::Config::Method.new search_lite_config
|
645
968
|
|
646
969
|
yield self if block_given?
|
647
970
|
end
|