google-cloud-discovery_engine-v1 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +12 -1
  3. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb +12 -1
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +12 -1
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +12 -1
  6. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +12 -1
  7. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +12 -1
  8. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +12 -1
  9. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +12 -1
  10. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +12 -1
  11. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +12 -1
  12. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +12 -1
  13. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb +12 -1
  14. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +12 -1
  15. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +12 -1
  16. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +12 -1
  17. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +12 -1
  18. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +188 -2
  19. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +188 -2
  20. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +12 -1
  21. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +12 -1
  22. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +12 -1
  23. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +12 -1
  24. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +2 -2
  25. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +12 -1
  26. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +2 -2
  27. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +12 -1
  28. data/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +12 -1
  29. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb +12 -1
  30. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  31. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +4 -1
  32. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +156 -0
  33. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +2 -2
  34. data/proto_docs/google/longrunning/operations.rb +18 -0
  35. metadata +3 -3
@@ -217,7 +217,7 @@ module Google
217
217
  # @param options [::Gapic::CallOptions, ::Hash]
218
218
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
219
219
  #
220
- # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil)
220
+ # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil)
221
221
  # Pass arguments to `search` via keyword arguments. Note that at
222
222
  # least one keyword argument is required. To specify no parameters, or to keep all
223
223
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -443,6 +443,99 @@ module Google
443
443
  # This feature is not supported for healthcare search.
444
444
  # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash]
445
445
  # Optional. The specification for returning the relevance score.
446
+ # @param ranking_expression [::String]
447
+ # The ranking expression controls the customized ranking on retrieval
448
+ # documents. This overrides
449
+ # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
450
+ # The syntax and supported features depend on the
451
+ # `ranking_expression_backend` value. If `ranking_expression_backend` is not
452
+ # provided, it defaults to `RANK_BY_EMBEDDING`.
453
+ #
454
+ # If
455
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
456
+ # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single
457
+ # function or multiple functions that are joined by "+".
458
+ #
459
+ # * ranking_expression = function, { " + ", function };
460
+ #
461
+ # Supported functions:
462
+ #
463
+ # * double * relevance_score
464
+ # * double * dotProduct(embedding_field_path)
465
+ #
466
+ # Function variables:
467
+ #
468
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
469
+ # between query and document.
470
+ # * `embedding_field_path`: the document embedding field
471
+ # used with query embedding vector.
472
+ # * `dotProduct`: embedding function between `embedding_field_path` and
473
+ # query embedding vector.
474
+ #
475
+ # Example ranking expression:
476
+ #
477
+ # If document has an embedding field doc_embedding, the ranking expression
478
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
479
+ #
480
+ # If
481
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
482
+ # is set to `RANK_BY_FORMULA`, the following expression types (and
483
+ # combinations of those chained using + or
484
+ # * operators) are supported:
485
+ #
486
+ # * `double`
487
+ # * `signal`
488
+ # * `log(signal)`
489
+ # * `exp(signal)`
490
+ # * `rr(signal, double > 0)` -- reciprocal rank transformation with second
491
+ # argument being a denominator constant.
492
+ # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise.
493
+ # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns
494
+ # signal2 | double, else returns signal1.
495
+ #
496
+ # Here are a few examples of ranking formulas that use the supported
497
+ # ranking expression types:
498
+ #
499
+ # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)`
500
+ # -- mostly rank by the logarithm of `keyword_similarity_score` with slight
501
+ # `semantic_smilarity_score` adjustment.
502
+ # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 *
503
+ # is_nan(keyword_similarity_score)` -- rank by the exponent of
504
+ # `semantic_similarity_score` filling the value with 0 if it's NaN, also
505
+ # add constant 0.3 adjustment to the final score if
506
+ # `semantic_similarity_score` is NaN.
507
+ # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 *
508
+ # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank
509
+ # of `keyword_similarity_score` with slight adjustment of reciprocal rank
510
+ # of `semantic_smilarity_score`.
511
+ #
512
+ # The following signals are supported:
513
+ #
514
+ # * `semantic_similarity_score`: semantic similarity adjustment that is
515
+ # calculated using the embeddings generated by a proprietary Google model.
516
+ # This score determines how semantically similar a search query is to a
517
+ # document.
518
+ # * `keyword_similarity_score`: keyword match adjustment uses the Best
519
+ # Match 25 (BM25) ranking function. This score is calculated using a
520
+ # probabilistic model to estimate the probability that a document is
521
+ # relevant to a given query.
522
+ # * `relevance_score`: semantic relevance adjustment that uses a
523
+ # proprietary Google model to determine the meaning and intent behind a
524
+ # user's query in context with the content in the documents.
525
+ # * `pctr_rank`: predicted conversion rate adjustment as a rank use
526
+ # predicted Click-through rate (pCTR) to gauge the relevance and
527
+ # attractiveness of a search result from a user's perspective. A higher
528
+ # pCTR suggests that the result is more likely to satisfy the user's query
529
+ # and intent, making it a valuable signal for ranking.
530
+ # * `freshness_rank`: freshness adjustment as a rank
531
+ # * `document_age`: The time in hours elapsed since the document was last
532
+ # updated, a floating-point number (e.g., 0.25 means 15 minutes).
533
+ # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary
534
+ # Google model to determine the keyword-based overlap between the query and
535
+ # the document.
536
+ # * `base_rank`: the default rank of the result
537
+ # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
538
+ # The backend to use for the ranking expression evaluation.
446
539
  #
447
540
  # @yield [response, operation] Access the result along with the RPC operation
448
541
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
@@ -539,7 +632,7 @@ module Google
539
632
  # @param options [::Gapic::CallOptions, ::Hash]
540
633
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
541
634
  #
542
- # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil)
635
+ # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil)
543
636
  # Pass arguments to `search_lite` via keyword arguments. Note that at
544
637
  # least one keyword argument is required. To specify no parameters, or to keep all
545
638
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -765,6 +858,99 @@ module Google
765
858
  # This feature is not supported for healthcare search.
766
859
  # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash]
767
860
  # Optional. The specification for returning the relevance score.
861
+ # @param ranking_expression [::String]
862
+ # The ranking expression controls the customized ranking on retrieval
863
+ # documents. This overrides
864
+ # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
865
+ # The syntax and supported features depend on the
866
+ # `ranking_expression_backend` value. If `ranking_expression_backend` is not
867
+ # provided, it defaults to `RANK_BY_EMBEDDING`.
868
+ #
869
+ # If
870
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
871
+ # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single
872
+ # function or multiple functions that are joined by "+".
873
+ #
874
+ # * ranking_expression = function, { " + ", function };
875
+ #
876
+ # Supported functions:
877
+ #
878
+ # * double * relevance_score
879
+ # * double * dotProduct(embedding_field_path)
880
+ #
881
+ # Function variables:
882
+ #
883
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
884
+ # between query and document.
885
+ # * `embedding_field_path`: the document embedding field
886
+ # used with query embedding vector.
887
+ # * `dotProduct`: embedding function between `embedding_field_path` and
888
+ # query embedding vector.
889
+ #
890
+ # Example ranking expression:
891
+ #
892
+ # If document has an embedding field doc_embedding, the ranking expression
893
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
894
+ #
895
+ # If
896
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
897
+ # is set to `RANK_BY_FORMULA`, the following expression types (and
898
+ # combinations of those chained using + or
899
+ # * operators) are supported:
900
+ #
901
+ # * `double`
902
+ # * `signal`
903
+ # * `log(signal)`
904
+ # * `exp(signal)`
905
+ # * `rr(signal, double > 0)` -- reciprocal rank transformation with second
906
+ # argument being a denominator constant.
907
+ # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise.
908
+ # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns
909
+ # signal2 | double, else returns signal1.
910
+ #
911
+ # Here are a few examples of ranking formulas that use the supported
912
+ # ranking expression types:
913
+ #
914
+ # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)`
915
+ # -- mostly rank by the logarithm of `keyword_similarity_score` with slight
916
+ # `semantic_smilarity_score` adjustment.
917
+ # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 *
918
+ # is_nan(keyword_similarity_score)` -- rank by the exponent of
919
+ # `semantic_similarity_score` filling the value with 0 if it's NaN, also
920
+ # add constant 0.3 adjustment to the final score if
921
+ # `semantic_similarity_score` is NaN.
922
+ # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 *
923
+ # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank
924
+ # of `keyword_similarity_score` with slight adjustment of reciprocal rank
925
+ # of `semantic_smilarity_score`.
926
+ #
927
+ # The following signals are supported:
928
+ #
929
+ # * `semantic_similarity_score`: semantic similarity adjustment that is
930
+ # calculated using the embeddings generated by a proprietary Google model.
931
+ # This score determines how semantically similar a search query is to a
932
+ # document.
933
+ # * `keyword_similarity_score`: keyword match adjustment uses the Best
934
+ # Match 25 (BM25) ranking function. This score is calculated using a
935
+ # probabilistic model to estimate the probability that a document is
936
+ # relevant to a given query.
937
+ # * `relevance_score`: semantic relevance adjustment that uses a
938
+ # proprietary Google model to determine the meaning and intent behind a
939
+ # user's query in context with the content in the documents.
940
+ # * `pctr_rank`: predicted conversion rate adjustment as a rank use
941
+ # predicted Click-through rate (pCTR) to gauge the relevance and
942
+ # attractiveness of a search result from a user's perspective. A higher
943
+ # pCTR suggests that the result is more likely to satisfy the user's query
944
+ # and intent, making it a valuable signal for ranking.
945
+ # * `freshness_rank`: freshness adjustment as a rank
946
+ # * `document_age`: The time in hours elapsed since the document was last
947
+ # updated, a floating-point number (e.g., 0.25 means 15 minutes).
948
+ # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary
949
+ # Google model to determine the keyword-based overlap between the query and
950
+ # the document.
951
+ # * `base_rank`: the default rank of the result
952
+ # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
953
+ # The backend to use for the ranking expression evaluation.
768
954
  #
769
955
  # @yield [response, operation] Access the result along with the RPC operation
770
956
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
@@ -210,7 +210,7 @@ module Google
210
210
  # @param options [::Gapic::CallOptions, ::Hash]
211
211
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
212
212
  #
213
- # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil)
213
+ # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil)
214
214
  # Pass arguments to `search` via keyword arguments. Note that at
215
215
  # least one keyword argument is required. To specify no parameters, or to keep all
216
216
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -436,6 +436,99 @@ module Google
436
436
  # This feature is not supported for healthcare search.
437
437
  # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash]
438
438
  # Optional. The specification for returning the relevance score.
439
+ # @param ranking_expression [::String]
440
+ # The ranking expression controls the customized ranking on retrieval
441
+ # documents. This overrides
442
+ # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
443
+ # The syntax and supported features depend on the
444
+ # `ranking_expression_backend` value. If `ranking_expression_backend` is not
445
+ # provided, it defaults to `RANK_BY_EMBEDDING`.
446
+ #
447
+ # If
448
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
449
+ # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single
450
+ # function or multiple functions that are joined by "+".
451
+ #
452
+ # * ranking_expression = function, { " + ", function };
453
+ #
454
+ # Supported functions:
455
+ #
456
+ # * double * relevance_score
457
+ # * double * dotProduct(embedding_field_path)
458
+ #
459
+ # Function variables:
460
+ #
461
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
462
+ # between query and document.
463
+ # * `embedding_field_path`: the document embedding field
464
+ # used with query embedding vector.
465
+ # * `dotProduct`: embedding function between `embedding_field_path` and
466
+ # query embedding vector.
467
+ #
468
+ # Example ranking expression:
469
+ #
470
+ # If document has an embedding field doc_embedding, the ranking expression
471
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
472
+ #
473
+ # If
474
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
475
+ # is set to `RANK_BY_FORMULA`, the following expression types (and
476
+ # combinations of those chained using + or
477
+ # * operators) are supported:
478
+ #
479
+ # * `double`
480
+ # * `signal`
481
+ # * `log(signal)`
482
+ # * `exp(signal)`
483
+ # * `rr(signal, double > 0)` -- reciprocal rank transformation with second
484
+ # argument being a denominator constant.
485
+ # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise.
486
+ # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns
487
+ # signal2 | double, else returns signal1.
488
+ #
489
+ # Here are a few examples of ranking formulas that use the supported
490
+ # ranking expression types:
491
+ #
492
+ # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)`
493
+ # -- mostly rank by the logarithm of `keyword_similarity_score` with slight
494
+ # `semantic_smilarity_score` adjustment.
495
+ # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 *
496
+ # is_nan(keyword_similarity_score)` -- rank by the exponent of
497
+ # `semantic_similarity_score` filling the value with 0 if it's NaN, also
498
+ # add constant 0.3 adjustment to the final score if
499
+ # `semantic_similarity_score` is NaN.
500
+ # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 *
501
+ # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank
502
+ # of `keyword_similarity_score` with slight adjustment of reciprocal rank
503
+ # of `semantic_smilarity_score`.
504
+ #
505
+ # The following signals are supported:
506
+ #
507
+ # * `semantic_similarity_score`: semantic similarity adjustment that is
508
+ # calculated using the embeddings generated by a proprietary Google model.
509
+ # This score determines how semantically similar a search query is to a
510
+ # document.
511
+ # * `keyword_similarity_score`: keyword match adjustment uses the Best
512
+ # Match 25 (BM25) ranking function. This score is calculated using a
513
+ # probabilistic model to estimate the probability that a document is
514
+ # relevant to a given query.
515
+ # * `relevance_score`: semantic relevance adjustment that uses a
516
+ # proprietary Google model to determine the meaning and intent behind a
517
+ # user's query in context with the content in the documents.
518
+ # * `pctr_rank`: predicted conversion rate adjustment as a rank use
519
+ # predicted Click-through rate (pCTR) to gauge the relevance and
520
+ # attractiveness of a search result from a user's perspective. A higher
521
+ # pCTR suggests that the result is more likely to satisfy the user's query
522
+ # and intent, making it a valuable signal for ranking.
523
+ # * `freshness_rank`: freshness adjustment as a rank
524
+ # * `document_age`: The time in hours elapsed since the document was last
525
+ # updated, a floating-point number (e.g., 0.25 means 15 minutes).
526
+ # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary
527
+ # Google model to determine the keyword-based overlap between the query and
528
+ # the document.
529
+ # * `base_rank`: the default rank of the result
530
+ # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
531
+ # The backend to use for the ranking expression evaluation.
439
532
  # @yield [result, operation] Access the result along with the TransportOperation object
440
533
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
441
534
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -525,7 +618,7 @@ module Google
525
618
  # @param options [::Gapic::CallOptions, ::Hash]
526
619
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
527
620
  #
528
- # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil)
621
+ # @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, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil)
529
622
  # Pass arguments to `search_lite` via keyword arguments. Note that at
530
623
  # least one keyword argument is required. To specify no parameters, or to keep all
531
624
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -751,6 +844,99 @@ module Google
751
844
  # This feature is not supported for healthcare search.
752
845
  # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash]
753
846
  # Optional. The specification for returning the relevance score.
847
+ # @param ranking_expression [::String]
848
+ # The ranking expression controls the customized ranking on retrieval
849
+ # documents. This overrides
850
+ # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
851
+ # The syntax and supported features depend on the
852
+ # `ranking_expression_backend` value. If `ranking_expression_backend` is not
853
+ # provided, it defaults to `RANK_BY_EMBEDDING`.
854
+ #
855
+ # If
856
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
857
+ # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single
858
+ # function or multiple functions that are joined by "+".
859
+ #
860
+ # * ranking_expression = function, { " + ", function };
861
+ #
862
+ # Supported functions:
863
+ #
864
+ # * double * relevance_score
865
+ # * double * dotProduct(embedding_field_path)
866
+ #
867
+ # Function variables:
868
+ #
869
+ # * `relevance_score`: pre-defined keywords, used for measure relevance
870
+ # between query and document.
871
+ # * `embedding_field_path`: the document embedding field
872
+ # used with query embedding vector.
873
+ # * `dotProduct`: embedding function between `embedding_field_path` and
874
+ # query embedding vector.
875
+ #
876
+ # Example ranking expression:
877
+ #
878
+ # If document has an embedding field doc_embedding, the ranking expression
879
+ # could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
880
+ #
881
+ # If
882
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
883
+ # is set to `RANK_BY_FORMULA`, the following expression types (and
884
+ # combinations of those chained using + or
885
+ # * operators) are supported:
886
+ #
887
+ # * `double`
888
+ # * `signal`
889
+ # * `log(signal)`
890
+ # * `exp(signal)`
891
+ # * `rr(signal, double > 0)` -- reciprocal rank transformation with second
892
+ # argument being a denominator constant.
893
+ # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise.
894
+ # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns
895
+ # signal2 | double, else returns signal1.
896
+ #
897
+ # Here are a few examples of ranking formulas that use the supported
898
+ # ranking expression types:
899
+ #
900
+ # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)`
901
+ # -- mostly rank by the logarithm of `keyword_similarity_score` with slight
902
+ # `semantic_smilarity_score` adjustment.
903
+ # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 *
904
+ # is_nan(keyword_similarity_score)` -- rank by the exponent of
905
+ # `semantic_similarity_score` filling the value with 0 if it's NaN, also
906
+ # add constant 0.3 adjustment to the final score if
907
+ # `semantic_similarity_score` is NaN.
908
+ # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 *
909
+ # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank
910
+ # of `keyword_similarity_score` with slight adjustment of reciprocal rank
911
+ # of `semantic_smilarity_score`.
912
+ #
913
+ # The following signals are supported:
914
+ #
915
+ # * `semantic_similarity_score`: semantic similarity adjustment that is
916
+ # calculated using the embeddings generated by a proprietary Google model.
917
+ # This score determines how semantically similar a search query is to a
918
+ # document.
919
+ # * `keyword_similarity_score`: keyword match adjustment uses the Best
920
+ # Match 25 (BM25) ranking function. This score is calculated using a
921
+ # probabilistic model to estimate the probability that a document is
922
+ # relevant to a given query.
923
+ # * `relevance_score`: semantic relevance adjustment that uses a
924
+ # proprietary Google model to determine the meaning and intent behind a
925
+ # user's query in context with the content in the documents.
926
+ # * `pctr_rank`: predicted conversion rate adjustment as a rank use
927
+ # predicted Click-through rate (pCTR) to gauge the relevance and
928
+ # attractiveness of a search result from a user's perspective. A higher
929
+ # pCTR suggests that the result is more likely to satisfy the user's query
930
+ # and intent, making it a valuable signal for ranking.
931
+ # * `freshness_rank`: freshness adjustment as a rank
932
+ # * `document_age`: The time in hours elapsed since the document was last
933
+ # updated, a floating-point number (e.g., 0.25 means 15 minutes).
934
+ # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary
935
+ # Google model to determine the keyword-based overlap between the query and
936
+ # the document.
937
+ # * `base_rank`: the default rank of the result
938
+ # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
939
+ # The backend to use for the ranking expression evaluation.
754
940
  # @yield [result, operation] Access the result along with the TransportOperation object
755
941
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
756
942
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -134,7 +134,7 @@ module Google
134
134
  # @param options [::Gapic::CallOptions, ::Hash]
135
135
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
136
136
  #
137
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
137
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
138
138
  # Pass arguments to `list_operations` via keyword arguments. Note that at
139
139
  # least one keyword argument is required. To specify no parameters, or to keep all
140
140
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -147,6 +147,17 @@ module Google
147
147
  # The standard list page size.
148
148
  # @param page_token [::String]
149
149
  # The standard list page token.
150
+ # @param return_partial_success [::Boolean]
151
+ # When set to `true`, operations that are reachable are returned as normal,
152
+ # and those that are unreachable are returned in the
153
+ # [ListOperationsResponse.unreachable] field.
154
+ #
155
+ # This can only be `true` when reading across collections e.g. when `parent`
156
+ # is set to `"projects/example/locations/-"`.
157
+ #
158
+ # This field is not by default supported and will result in an
159
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
160
+ # service or product specific documentation.
150
161
  #
151
162
  # @yield [response, operation] Access the result along with the RPC operation
152
163
  # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
@@ -125,7 +125,7 @@ module Google
125
125
  # @param options [::Gapic::CallOptions, ::Hash]
126
126
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
127
  #
128
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
128
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
129
129
  # Pass arguments to `list_operations` via keyword arguments. Note that at
130
130
  # least one keyword argument is required. To specify no parameters, or to keep all
131
131
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -138,6 +138,17 @@ module Google
138
138
  # The standard list page size.
139
139
  # @param page_token [::String]
140
140
  # The standard list page token.
141
+ # @param return_partial_success [::Boolean]
142
+ # When set to `true`, operations that are reachable are returned as normal,
143
+ # and those that are unreachable are returned in the
144
+ # [ListOperationsResponse.unreachable] field.
145
+ #
146
+ # This can only be `true` when reading across collections e.g. when `parent`
147
+ # is set to `"projects/example/locations/-"`.
148
+ #
149
+ # This field is not by default supported and will result in an
150
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
151
+ # service or product specific documentation.
141
152
  # @yield [result, operation] Access the result along with the TransportOperation object
142
153
  # @yieldparam result [::Gapic::Operation]
143
154
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -134,7 +134,7 @@ module Google
134
134
  # @param options [::Gapic::CallOptions, ::Hash]
135
135
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
136
136
  #
137
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
137
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
138
138
  # Pass arguments to `list_operations` via keyword arguments. Note that at
139
139
  # least one keyword argument is required. To specify no parameters, or to keep all
140
140
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -147,6 +147,17 @@ module Google
147
147
  # The standard list page size.
148
148
  # @param page_token [::String]
149
149
  # The standard list page token.
150
+ # @param return_partial_success [::Boolean]
151
+ # When set to `true`, operations that are reachable are returned as normal,
152
+ # and those that are unreachable are returned in the
153
+ # [ListOperationsResponse.unreachable] field.
154
+ #
155
+ # This can only be `true` when reading across collections e.g. when `parent`
156
+ # is set to `"projects/example/locations/-"`.
157
+ #
158
+ # This field is not by default supported and will result in an
159
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
160
+ # service or product specific documentation.
150
161
  #
151
162
  # @yield [response, operation] Access the result along with the RPC operation
152
163
  # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
@@ -125,7 +125,7 @@ module Google
125
125
  # @param options [::Gapic::CallOptions, ::Hash]
126
126
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
127
  #
128
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
128
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
129
129
  # Pass arguments to `list_operations` via keyword arguments. Note that at
130
130
  # least one keyword argument is required. To specify no parameters, or to keep all
131
131
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -138,6 +138,17 @@ module Google
138
138
  # The standard list page size.
139
139
  # @param page_token [::String]
140
140
  # The standard list page token.
141
+ # @param return_partial_success [::Boolean]
142
+ # When set to `true`, operations that are reachable are returned as normal,
143
+ # and those that are unreachable are returned in the
144
+ # [ListOperationsResponse.unreachable] field.
145
+ #
146
+ # This can only be `true` when reading across collections e.g. when `parent`
147
+ # is set to `"projects/example/locations/-"`.
148
+ #
149
+ # This field is not by default supported and will result in an
150
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
151
+ # service or product specific documentation.
141
152
  # @yield [result, operation] Access the result along with the TransportOperation object
142
153
  # @yieldparam result [::Gapic::Operation]
143
154
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -248,7 +248,7 @@ module Google
248
248
  # is:
249
249
  # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
250
250
  # If the write user event action is applied in
251
- # `::Google::Cloud::Location::Location` level, for example, the event
251
+ # [Location][google.cloud.location.Location] level, for example, the event
252
252
  # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
253
253
  # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
254
254
  # `projects/{project}/locations/{location}`.
@@ -351,7 +351,7 @@ module Google
351
351
  # is:
352
352
  # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
353
353
  # If the collect user event action is applied in
354
- # `::Google::Cloud::Location::Location` level, for example, the event
354
+ # [Location][google.cloud.location.Location] level, for example, the event
355
355
  # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
356
356
  # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
357
357
  # `projects/{project}/locations/{location}`.
@@ -134,7 +134,7 @@ module Google
134
134
  # @param options [::Gapic::CallOptions, ::Hash]
135
135
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
136
136
  #
137
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
137
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
138
138
  # Pass arguments to `list_operations` via keyword arguments. Note that at
139
139
  # least one keyword argument is required. To specify no parameters, or to keep all
140
140
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -147,6 +147,17 @@ module Google
147
147
  # The standard list page size.
148
148
  # @param page_token [::String]
149
149
  # The standard list page token.
150
+ # @param return_partial_success [::Boolean]
151
+ # When set to `true`, operations that are reachable are returned as normal,
152
+ # and those that are unreachable are returned in the
153
+ # [ListOperationsResponse.unreachable] field.
154
+ #
155
+ # This can only be `true` when reading across collections e.g. when `parent`
156
+ # is set to `"projects/example/locations/-"`.
157
+ #
158
+ # This field is not by default supported and will result in an
159
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
160
+ # service or product specific documentation.
150
161
  #
151
162
  # @yield [response, operation] Access the result along with the RPC operation
152
163
  # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
@@ -241,7 +241,7 @@ module Google
241
241
  # is:
242
242
  # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
243
243
  # If the write user event action is applied in
244
- # `::Google::Cloud::Location::Location` level, for example, the event
244
+ # [Location][google.cloud.location.Location] level, for example, the event
245
245
  # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
246
246
  # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
247
247
  # `projects/{project}/locations/{location}`.
@@ -337,7 +337,7 @@ module Google
337
337
  # is:
338
338
  # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
339
339
  # If the collect user event action is applied in
340
- # `::Google::Cloud::Location::Location` level, for example, the event
340
+ # [Location][google.cloud.location.Location] level, for example, the event
341
341
  # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
342
342
  # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
343
343
  # `projects/{project}/locations/{location}`.