google-cloud-discovery_engine-v1 2.4.0 → 2.5.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +188 -2
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +188 -2
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +4 -1
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +156 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40ed5372fc315235290e407f2b17d1ca6e5394c36d2e17826976d0ac98b8ba05
|
4
|
+
data.tar.gz: baca2c4ace1f090cd2af7a6f4a38b738bab4aa8e68d4a6d913b59ff49c1dc569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 542a589b36d957723454ef178dd0b07bc46c7a0066209d41cfa8b0f4debd6f5c3cf52fd11a9ff9f4b567243749f2ae255768d7b1815fa25bd01f7518225bc2ef
|
7
|
+
data.tar.gz: 7a87110e06239a4de33da600d56bef8a9161b061577defbc69353cd8cb57fbf21aad693819387d272596289eb3ebf6fffb31493e230dd8a9c03fe63699631679
|
@@ -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]
|
@@ -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
|
-
#
|
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
|
-
#
|
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}`.
|
@@ -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
|
-
#
|
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
|
-
#
|
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}`.
|
@@ -14,7 +14,7 @@ require 'google/cloud/discoveryengine/v1/document_pb'
|
|
14
14
|
require 'google/protobuf/struct_pb'
|
15
15
|
|
16
16
|
|
17
|
-
descriptor_data = "\n4google/cloud/discoveryengine/v1/search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/discoveryengine/v1/chunk.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xbc\x30\n\rSearchRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x06\x62ranch\x18\x02 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12N\n\x0bimage_query\x18\x13 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12\x19\n\x11one_box_page_size\x18/ \x01(\x05\x12V\n\x10\x64\x61ta_store_specs\x18 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x12\x0e\n\x06\x66ilter\x18\x07 \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1d \x01(\t\x12\x10\n\x08order_by\x18\x08 \x01(\t\x12<\n\tuser_info\x18\x15 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x15\n\rlanguage_code\x18# \x01(\t\x12M\n\x0b\x66\x61\x63\x65t_specs\x18\t \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12J\n\x06params\x18\x0b \x03(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.ParamsEntry\x12_\n\x14query_expansion_spec\x18\r \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec\x12\x61\n\x15spell_correction_spec\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec\x12\x16\n\x0euser_pseudo_id\x18\x0f \x01(\t\x12]\n\x13\x63ontent_search_spec\x18\x18 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec\x12\x13\n\x0bsafe_search\x18\x14 \x01(\x08\x12S\n\x0buser_labels\x18\x16 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xe8\x16\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x1a\xd9\x02\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t2\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3"
|
17
|
+
descriptor_data = "\n4google/cloud/discoveryengine/v1/search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/discoveryengine/v1/chunk.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xca\x32\n\rSearchRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x06\x62ranch\x18\x02 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12N\n\x0bimage_query\x18\x13 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12\x19\n\x11one_box_page_size\x18/ \x01(\x05\x12V\n\x10\x64\x61ta_store_specs\x18 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x12\x0e\n\x06\x66ilter\x18\x07 \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1d \x01(\t\x12\x10\n\x08order_by\x18\x08 \x01(\t\x12<\n\tuser_info\x18\x15 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x15\n\rlanguage_code\x18# \x01(\t\x12M\n\x0b\x66\x61\x63\x65t_specs\x18\t \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12J\n\x06params\x18\x0b \x03(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.ParamsEntry\x12_\n\x14query_expansion_spec\x18\r \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec\x12\x61\n\x15spell_correction_spec\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec\x12\x16\n\x0euser_pseudo_id\x18\x0f \x01(\t\x12]\n\x13\x63ontent_search_spec\x18\x18 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec\x12\x13\n\x0bsafe_search\x18\x14 \x01(\x08\x12S\n\x0buser_labels\x18\x16 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x12\x1a\n\x12ranking_expression\x18\x1a \x01(\t\x12p\n\x1aranking_expression_backend\x18\x35 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackendB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"~\n\x18RankingExpressionBackend\x12*\n&RANKING_EXPRESSION_BACKEND_UNSPECIFIED\x10\x00\x12\x15\n\x11RANK_BY_EMBEDDING\x10\x03\x12\x13\n\x0fRANK_BY_FORMULA\x10\x04\"\x04\x08\x01\x10\x01\"\x04\x08\x02\x10\x02\"\xbe\x1c\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x1a\xaf\x08\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x12\x63\n\x0crank_signals\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignalsB\x03\xe0\x41\x01\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xee\x04\n\x0bRankSignals\x12*\n\x18keyword_similarity_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12!\n\x0frelevance_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12+\n\x19semantic_similarity_score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1b\n\tpctr_rank\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12!\n\x0ftopicality_rank\x18\x06 \x01(\x02\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1e\n\x0c\x64ocument_age\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12!\n\x0f\x62oosting_factor\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x19\n\x0c\x64\x65\x66\x61ult_rank\x18 \x01(\x02\x42\x03\xe0\x41\x01\x12r\n\x0e\x63ustom_signals\x18! \x03(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignalB\x03\xe0\x41\x01\x1a\x35\n\x0c\x43ustomSignal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x42\x1b\n\x19_keyword_similarity_scoreB\x12\n\x10_relevance_scoreB\x1c\n\x1a_semantic_similarity_scoreB\x0c\n\n_pctr_rankB\x12\n\x10_topicality_rankB\x0f\n\r_document_ageB\x12\n\x10_boosting_factorJ\x04\x08\x05\x10\x06\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t2\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3"
|
18
18
|
|
19
19
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
20
20
|
|
@@ -78,8 +78,11 @@ module Google
|
|
78
78
|
SearchRequest::SessionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SessionSpec").msgclass
|
79
79
|
SearchRequest::RelevanceScoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec").msgclass
|
80
80
|
SearchRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold").enummodule
|
81
|
+
SearchRequest::RankingExpressionBackend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend").enummodule
|
81
82
|
SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse").msgclass
|
82
83
|
SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult").msgclass
|
84
|
+
SearchResponse::SearchResult::RankSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals").msgclass
|
85
|
+
SearchResponse::SearchResult::RankSignals::CustomSignal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal").msgclass
|
83
86
|
SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet").msgclass
|
84
87
|
SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue").msgclass
|
85
88
|
SearchResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary").msgclass
|
@@ -274,6 +274,101 @@ module Google
|
|
274
274
|
# @!attribute [rw] relevance_score_spec
|
275
275
|
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec]
|
276
276
|
# Optional. The specification for returning the relevance score.
|
277
|
+
# @!attribute [rw] ranking_expression
|
278
|
+
# @return [::String]
|
279
|
+
# The ranking expression controls the customized ranking on retrieval
|
280
|
+
# documents. This overrides
|
281
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
|
282
|
+
# The syntax and supported features depend on the
|
283
|
+
# `ranking_expression_backend` value. If `ranking_expression_backend` is not
|
284
|
+
# provided, it defaults to `RANK_BY_EMBEDDING`.
|
285
|
+
#
|
286
|
+
# If
|
287
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
|
288
|
+
# is not provided or set to `RANK_BY_EMBEDDING`, it should be a single
|
289
|
+
# function or multiple functions that are joined by "+".
|
290
|
+
#
|
291
|
+
# * ranking_expression = function, { " + ", function };
|
292
|
+
#
|
293
|
+
# Supported functions:
|
294
|
+
#
|
295
|
+
# * double * relevance_score
|
296
|
+
# * double * dotProduct(embedding_field_path)
|
297
|
+
#
|
298
|
+
# Function variables:
|
299
|
+
#
|
300
|
+
# * `relevance_score`: pre-defined keywords, used for measure relevance
|
301
|
+
# between query and document.
|
302
|
+
# * `embedding_field_path`: the document embedding field
|
303
|
+
# used with query embedding vector.
|
304
|
+
# * `dotProduct`: embedding function between `embedding_field_path` and
|
305
|
+
# query embedding vector.
|
306
|
+
#
|
307
|
+
# Example ranking expression:
|
308
|
+
#
|
309
|
+
# If document has an embedding field doc_embedding, the ranking expression
|
310
|
+
# could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
311
|
+
#
|
312
|
+
# If
|
313
|
+
# {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend}
|
314
|
+
# is set to `RANK_BY_FORMULA`, the following expression types (and
|
315
|
+
# combinations of those chained using + or
|
316
|
+
# * operators) are supported:
|
317
|
+
#
|
318
|
+
# * `double`
|
319
|
+
# * `signal`
|
320
|
+
# * `log(signal)`
|
321
|
+
# * `exp(signal)`
|
322
|
+
# * `rr(signal, double > 0)` -- reciprocal rank transformation with second
|
323
|
+
# argument being a denominator constant.
|
324
|
+
# * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise.
|
325
|
+
# * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns
|
326
|
+
# signal2 | double, else returns signal1.
|
327
|
+
#
|
328
|
+
# Here are a few examples of ranking formulas that use the supported
|
329
|
+
# ranking expression types:
|
330
|
+
#
|
331
|
+
# - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)`
|
332
|
+
# -- mostly rank by the logarithm of `keyword_similarity_score` with slight
|
333
|
+
# `semantic_smilarity_score` adjustment.
|
334
|
+
# - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 *
|
335
|
+
# is_nan(keyword_similarity_score)` -- rank by the exponent of
|
336
|
+
# `semantic_similarity_score` filling the value with 0 if it's NaN, also
|
337
|
+
# add constant 0.3 adjustment to the final score if
|
338
|
+
# `semantic_similarity_score` is NaN.
|
339
|
+
# - `0.2 * rr(semantic_similarity_score, 16) + 0.8 *
|
340
|
+
# rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank
|
341
|
+
# of `keyword_similarity_score` with slight adjustment of reciprocal rank
|
342
|
+
# of `semantic_smilarity_score`.
|
343
|
+
#
|
344
|
+
# The following signals are supported:
|
345
|
+
#
|
346
|
+
# * `semantic_similarity_score`: semantic similarity adjustment that is
|
347
|
+
# calculated using the embeddings generated by a proprietary Google model.
|
348
|
+
# This score determines how semantically similar a search query is to a
|
349
|
+
# document.
|
350
|
+
# * `keyword_similarity_score`: keyword match adjustment uses the Best
|
351
|
+
# Match 25 (BM25) ranking function. This score is calculated using a
|
352
|
+
# probabilistic model to estimate the probability that a document is
|
353
|
+
# relevant to a given query.
|
354
|
+
# * `relevance_score`: semantic relevance adjustment that uses a
|
355
|
+
# proprietary Google model to determine the meaning and intent behind a
|
356
|
+
# user's query in context with the content in the documents.
|
357
|
+
# * `pctr_rank`: predicted conversion rate adjustment as a rank use
|
358
|
+
# predicted Click-through rate (pCTR) to gauge the relevance and
|
359
|
+
# attractiveness of a search result from a user's perspective. A higher
|
360
|
+
# pCTR suggests that the result is more likely to satisfy the user's query
|
361
|
+
# and intent, making it a valuable signal for ranking.
|
362
|
+
# * `freshness_rank`: freshness adjustment as a rank
|
363
|
+
# * `document_age`: The time in hours elapsed since the document was last
|
364
|
+
# updated, a floating-point number (e.g., 0.25 means 15 minutes).
|
365
|
+
# * `topicality_rank`: topicality adjustment as a rank. Uses proprietary
|
366
|
+
# Google model to determine the keyword-based overlap between the query and
|
367
|
+
# the document.
|
368
|
+
# * `base_rank`: the default rank of the result
|
369
|
+
# @!attribute [rw] ranking_expression_backend
|
370
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
|
371
|
+
# The backend to use for the ranking expression evaluation.
|
277
372
|
class SearchRequest
|
278
373
|
include ::Google::Protobuf::MessageExts
|
279
374
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -1073,6 +1168,19 @@ module Google
|
|
1073
1168
|
# High relevance threshold.
|
1074
1169
|
HIGH = 4
|
1075
1170
|
end
|
1171
|
+
|
1172
|
+
# The backend to use for the ranking expression evaluation.
|
1173
|
+
module RankingExpressionBackend
|
1174
|
+
# Default option for unspecified/unknown values.
|
1175
|
+
RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0
|
1176
|
+
|
1177
|
+
# Ranking by custom embedding model, the default way to evaluate the
|
1178
|
+
# ranking expression.
|
1179
|
+
RANK_BY_EMBEDDING = 3
|
1180
|
+
|
1181
|
+
# Ranking by custom formula.
|
1182
|
+
RANK_BY_FORMULA = 4
|
1183
|
+
end
|
1076
1184
|
end
|
1077
1185
|
|
1078
1186
|
# Response message for
|
@@ -1158,6 +1266,9 @@ module Google
|
|
1158
1266
|
# @!attribute [r] model_scores
|
1159
1267
|
# @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
|
1160
1268
|
# Output only. Google provided available scores.
|
1269
|
+
# @!attribute [rw] rank_signals
|
1270
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
|
1271
|
+
# A set of ranking signals associated with the result.
|
1161
1272
|
class SearchResult
|
1162
1273
|
include ::Google::Protobuf::MessageExts
|
1163
1274
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -1170,6 +1281,51 @@ module Google
|
|
1170
1281
|
include ::Google::Protobuf::MessageExts
|
1171
1282
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
1172
1283
|
end
|
1284
|
+
|
1285
|
+
# A set of ranking signals.
|
1286
|
+
# @!attribute [rw] keyword_similarity_score
|
1287
|
+
# @return [::Float]
|
1288
|
+
# Keyword matching adjustment.
|
1289
|
+
# @!attribute [rw] relevance_score
|
1290
|
+
# @return [::Float]
|
1291
|
+
# Semantic relevance adjustment.
|
1292
|
+
# @!attribute [rw] semantic_similarity_score
|
1293
|
+
# @return [::Float]
|
1294
|
+
# Semantic similarity adjustment.
|
1295
|
+
# @!attribute [rw] pctr_rank
|
1296
|
+
# @return [::Float]
|
1297
|
+
# Predicted conversion rate adjustment as a rank.
|
1298
|
+
# @!attribute [rw] topicality_rank
|
1299
|
+
# @return [::Float]
|
1300
|
+
# Topicality adjustment as a rank.
|
1301
|
+
# @!attribute [rw] document_age
|
1302
|
+
# @return [::Float]
|
1303
|
+
# Age of the document in hours.
|
1304
|
+
# @!attribute [rw] boosting_factor
|
1305
|
+
# @return [::Float]
|
1306
|
+
# Combined custom boosts for a doc.
|
1307
|
+
# @!attribute [rw] default_rank
|
1308
|
+
# @return [::Float]
|
1309
|
+
# The default rank of the result.
|
1310
|
+
# @!attribute [rw] custom_signals
|
1311
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
|
1312
|
+
# A list of custom clearbox signals.
|
1313
|
+
class RankSignals
|
1314
|
+
include ::Google::Protobuf::MessageExts
|
1315
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
1316
|
+
|
1317
|
+
# Custom clearbox signal represented by name and value pair.
|
1318
|
+
# @!attribute [rw] name
|
1319
|
+
# @return [::String]
|
1320
|
+
# Name of the signal.
|
1321
|
+
# @!attribute [rw] value
|
1322
|
+
# @return [::Float]
|
1323
|
+
# Float value representing the ranking signal (e.g. 1.25 for BM25).
|
1324
|
+
class CustomSignal
|
1325
|
+
include ::Google::Protobuf::MessageExts
|
1326
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
1327
|
+
end
|
1328
|
+
end
|
1173
1329
|
end
|
1174
1330
|
|
1175
1331
|
# A facet result.
|
@@ -30,7 +30,7 @@ module Google
|
|
30
30
|
# is:
|
31
31
|
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
|
32
32
|
# If the write user event action is applied in
|
33
|
-
#
|
33
|
+
# [Location][google.cloud.location.Location] level, for example, the event
|
34
34
|
# with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
|
35
35
|
# {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
|
36
36
|
# `projects/{project}/locations/{location}`.
|
@@ -55,7 +55,7 @@ module Google
|
|
55
55
|
# is:
|
56
56
|
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
|
57
57
|
# If the collect user event action is applied in
|
58
|
-
#
|
58
|
+
# [Location][google.cloud.location.Location] level, for example, the event
|
59
59
|
# with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple
|
60
60
|
# {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is:
|
61
61
|
# `projects/{project}/locations/{location}`.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-discovery_engine-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '1.
|
18
|
+
version: '1.2'
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '1.
|
25
|
+
version: '1.2'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: google-cloud-errors
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|