@google-cloud/discoveryengine 2.5.2 → 2.5.3
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.
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +30 -1
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +459 -134
- package/build/protos/protos.d.ts +1400 -103
- package/build/protos/protos.js +3602 -201
- package/build/protos/protos.json +331 -35
- package/build/src/v1/assistant_service_client.js +1 -1
- package/build/src/v1/cmek_config_service_client.js +1 -1
- package/build/src/v1/completion_service_client.js +1 -1
- package/build/src/v1/control_service_client.js +1 -1
- package/build/src/v1/conversational_search_service_client.js +1 -1
- package/build/src/v1/data_store_service_client.js +1 -1
- package/build/src/v1/document_service_client.js +1 -1
- package/build/src/v1/engine_service_client.js +1 -1
- package/build/src/v1/grounded_generation_service_client.js +1 -1
- package/build/src/v1/identity_mapping_store_service_client.js +1 -1
- package/build/src/v1/index.js +1 -1
- package/build/src/v1/project_service_client.js +1 -1
- package/build/src/v1/rank_service_client.js +1 -1
- package/build/src/v1/recommendation_service_client.js +1 -1
- package/build/src/v1/schema_service_client.js +1 -1
- package/build/src/v1/search_service_client.d.ts +672 -432
- package/build/src/v1/search_service_client.js +449 -289
- package/build/src/v1/search_tuning_service_client.js +1 -1
- package/build/src/v1/serving_config_service_client.js +1 -1
- package/build/src/v1/session_service_client.js +1 -1
- package/build/src/v1/site_search_engine_service_client.js +1 -1
- package/build/src/v1/user_event_service_client.js +1 -1
- package/build/src/v1/user_license_service_client.js +1 -1
- package/build/src/v1alpha/acl_config_service_client.js +1 -1
- package/build/src/v1alpha/chunk_service_client.js +1 -1
- package/build/src/v1alpha/completion_service_client.js +1 -1
- package/build/src/v1alpha/control_service_client.js +1 -1
- package/build/src/v1alpha/conversational_search_service_client.js +1 -1
- package/build/src/v1alpha/data_store_service_client.js +1 -1
- package/build/src/v1alpha/document_service_client.js +1 -1
- package/build/src/v1alpha/engine_service_client.js +1 -1
- package/build/src/v1alpha/estimate_billing_service_client.js +1 -1
- package/build/src/v1alpha/evaluation_service_client.js +1 -1
- package/build/src/v1alpha/grounded_generation_service_client.js +1 -1
- package/build/src/v1alpha/index.js +1 -1
- package/build/src/v1alpha/project_service_client.js +1 -1
- package/build/src/v1alpha/rank_service_client.js +1 -1
- package/build/src/v1alpha/recommendation_service_client.js +1 -1
- package/build/src/v1alpha/sample_query_service_client.js +1 -1
- package/build/src/v1alpha/sample_query_set_service_client.js +1 -1
- package/build/src/v1alpha/schema_service_client.js +1 -1
- package/build/src/v1alpha/search_service_client.js +1 -1
- package/build/src/v1alpha/search_tuning_service_client.js +1 -1
- package/build/src/v1alpha/serving_config_service_client.js +1 -1
- package/build/src/v1alpha/session_service_client.js +1 -1
- package/build/src/v1alpha/site_search_engine_service_client.js +1 -1
- package/build/src/v1alpha/user_event_service_client.js +1 -1
- package/build/src/v1beta/completion_service_client.js +1 -1
- package/build/src/v1beta/control_service_client.js +1 -1
- package/build/src/v1beta/conversational_search_service_client.js +1 -1
- package/build/src/v1beta/data_store_service_client.js +1 -1
- package/build/src/v1beta/document_service_client.js +1 -1
- package/build/src/v1beta/engine_service_client.js +1 -1
- package/build/src/v1beta/evaluation_service_client.js +1 -1
- package/build/src/v1beta/grounded_generation_service_client.js +1 -1
- package/build/src/v1beta/index.js +1 -1
- package/build/src/v1beta/project_service_client.js +1 -1
- package/build/src/v1beta/rank_service_client.js +1 -1
- package/build/src/v1beta/recommendation_service_client.js +1 -1
- package/build/src/v1beta/sample_query_service_client.js +1 -1
- package/build/src/v1beta/sample_query_set_service_client.js +1 -1
- package/build/src/v1beta/schema_service_client.js +1 -1
- package/build/src/v1beta/search_service_client.js +1 -1
- package/build/src/v1beta/search_tuning_service_client.js +1 -1
- package/build/src/v1beta/serving_config_service_client.js +1 -1
- package/build/src/v1beta/session_service_client.js +1 -1
- package/build/src/v1beta/site_search_engine_service_client.js +1 -1
- package/build/src/v1beta/user_event_service_client.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -105,6 +105,8 @@ message SearchRequest {
|
|
|
105
105
|
// Required. Full resource name of
|
|
106
106
|
// [DataStore][google.cloud.discoveryengine.v1.DataStore], such as
|
|
107
107
|
// `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
|
|
108
|
+
// The path must include the project number, project id is not supported for
|
|
109
|
+
// this field.
|
|
108
110
|
string data_store = 1 [
|
|
109
111
|
(google.api.field_behavior) = REQUIRED,
|
|
110
112
|
(google.api.resource_reference) = {
|
|
@@ -204,7 +206,6 @@ message SearchRequest {
|
|
|
204
206
|
|
|
205
207
|
// List of keys to exclude when faceting.
|
|
206
208
|
//
|
|
207
|
-
//
|
|
208
209
|
// By default,
|
|
209
210
|
// [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
|
|
210
211
|
// is not excluded from the filter unless it is listed in this field.
|
|
@@ -696,6 +697,76 @@ message SearchRequest {
|
|
|
696
697
|
ChunkSpec chunk_spec = 5;
|
|
697
698
|
}
|
|
698
699
|
|
|
700
|
+
// Specification to enable natural language understanding capabilities for
|
|
701
|
+
// search requests.
|
|
702
|
+
message NaturalLanguageQueryUnderstandingSpec {
|
|
703
|
+
// Enum describing under which condition filter extraction should occur.
|
|
704
|
+
enum FilterExtractionCondition {
|
|
705
|
+
// Server behavior defaults to `DISABLED`.
|
|
706
|
+
CONDITION_UNSPECIFIED = 0;
|
|
707
|
+
|
|
708
|
+
// Disables NL filter extraction.
|
|
709
|
+
DISABLED = 1;
|
|
710
|
+
|
|
711
|
+
// Enables NL filter extraction.
|
|
712
|
+
ENABLED = 2;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// Enum describing how extracted filters are applied to the search.
|
|
716
|
+
enum ExtractedFilterBehavior {
|
|
717
|
+
// `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
|
|
718
|
+
// for extracted filters. For single datastore search, the default is to
|
|
719
|
+
// apply as hard filters. For multi-datastore search, the default is to
|
|
720
|
+
// apply as soft boosts.
|
|
721
|
+
EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0;
|
|
722
|
+
|
|
723
|
+
// Applies all extracted filters as hard filters on the results. Results
|
|
724
|
+
// that do not pass the extracted filters will not be returned in the
|
|
725
|
+
// result set.
|
|
726
|
+
HARD_FILTER = 1;
|
|
727
|
+
|
|
728
|
+
// Applies all extracted filters as soft boosts. Results that pass the
|
|
729
|
+
// filters will be boosted up to higher ranks in the result set.
|
|
730
|
+
SOFT_BOOST = 2;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// The condition under which filter extraction should occur.
|
|
734
|
+
// Server behavior defaults to `DISABLED`.
|
|
735
|
+
FilterExtractionCondition filter_extraction_condition = 1;
|
|
736
|
+
|
|
737
|
+
// Field names used for location-based filtering, where geolocation filters
|
|
738
|
+
// are detected in natural language search queries.
|
|
739
|
+
// Only valid when the FilterExtractionCondition is set to `ENABLED`.
|
|
740
|
+
//
|
|
741
|
+
// If this field is set, it overrides the field names set in
|
|
742
|
+
// [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1.ServingConfig.geo_search_query_detection_field_names].
|
|
743
|
+
repeated string geo_search_query_detection_field_names = 2;
|
|
744
|
+
|
|
745
|
+
// Optional. Controls behavior of how extracted filters are applied to the
|
|
746
|
+
// search. The default behavior depends on the request. For single datastore
|
|
747
|
+
// structured search, the default is `HARD_FILTER`. For multi-datastore
|
|
748
|
+
// search, the default behavior is `SOFT_BOOST`.
|
|
749
|
+
// Location-based filters are always applied as hard filters, and the
|
|
750
|
+
// `SOFT_BOOST` setting will not affect them.
|
|
751
|
+
// This field is only used if
|
|
752
|
+
// [SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition][google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition]
|
|
753
|
+
// is set to
|
|
754
|
+
// [FilterExtractionCondition.ENABLED][google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition.ENABLED].
|
|
755
|
+
ExtractedFilterBehavior extracted_filter_behavior = 3
|
|
756
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
757
|
+
|
|
758
|
+
// Optional. Allowlist of fields that can be used for natural language
|
|
759
|
+
// filter extraction. By default, if this is unspecified, all indexable
|
|
760
|
+
// fields are eligible for natural language filter extraction (but are not
|
|
761
|
+
// guaranteed to be used). If any fields are specified in
|
|
762
|
+
// allowed_field_names, only the fields that are both marked as indexable in
|
|
763
|
+
// the schema and specified in the allowlist will be eligible for natural
|
|
764
|
+
// language filter extraction. Note: for multi-datastore search, this is not
|
|
765
|
+
// yet supported, and will be ignored.
|
|
766
|
+
repeated string allowed_field_names = 4
|
|
767
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
768
|
+
}
|
|
769
|
+
|
|
699
770
|
// Specification for search as you type in search requests.
|
|
700
771
|
message SearchAsYouTypeSpec {
|
|
701
772
|
// Enum describing under which condition search as you type should occur.
|
|
@@ -739,6 +810,42 @@ message SearchRequest {
|
|
|
739
810
|
MatchHighlightingCondition match_highlighting_condition = 1;
|
|
740
811
|
}
|
|
741
812
|
|
|
813
|
+
// Specification for crowding. Crowding improves the diversity of search
|
|
814
|
+
// results by limiting the number of results that share the same field value.
|
|
815
|
+
// For example, crowding on the color field with a max_count of 3 and mode
|
|
816
|
+
// DROP_CROWDED_RESULTS will return at most 3 results with the same color
|
|
817
|
+
// across all pages.
|
|
818
|
+
message CrowdingSpec {
|
|
819
|
+
// Enum describing the mode to use for documents that are crowded away.
|
|
820
|
+
// They can be dropped or demoted to the later pages.
|
|
821
|
+
enum Mode {
|
|
822
|
+
// Unspecified crowding mode. In this case, server behavior defaults to
|
|
823
|
+
// [Mode.DROP_CROWDED_RESULTS][google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode.DROP_CROWDED_RESULTS].
|
|
824
|
+
MODE_UNSPECIFIED = 0;
|
|
825
|
+
|
|
826
|
+
// Drop crowded results.
|
|
827
|
+
DROP_CROWDED_RESULTS = 1;
|
|
828
|
+
|
|
829
|
+
// Demote crowded results to the later pages.
|
|
830
|
+
DEMOTE_CROWDED_RESULTS_TO_END = 2;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// The field to use for crowding. Documents can be crowded by a field in the
|
|
834
|
+
// [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
|
|
835
|
+
// field is case sensitive.
|
|
836
|
+
string field = 1;
|
|
837
|
+
|
|
838
|
+
// The maximum number of documents to keep per value of the field. Once
|
|
839
|
+
// there are at least max_count previous results which contain the same
|
|
840
|
+
// value for the given field (according to the order specified in
|
|
841
|
+
// `order_by`), later results with the same value are "crowded away".
|
|
842
|
+
// If not specified, the default value is 1.
|
|
843
|
+
int32 max_count = 2;
|
|
844
|
+
|
|
845
|
+
// Mode to use for documents that are crowded away.
|
|
846
|
+
Mode mode = 3;
|
|
847
|
+
}
|
|
848
|
+
|
|
742
849
|
// Session specification.
|
|
743
850
|
//
|
|
744
851
|
// Multi-turn Search feature is currently at private GA stage. Please use
|
|
@@ -789,6 +896,30 @@ message SearchRequest {
|
|
|
789
896
|
bool return_relevance_score = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
790
897
|
}
|
|
791
898
|
|
|
899
|
+
// The backend to use for the ranking expression evaluation.
|
|
900
|
+
enum RankingExpressionBackend {
|
|
901
|
+
// Default option for unspecified/unknown values.
|
|
902
|
+
RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0;
|
|
903
|
+
|
|
904
|
+
// Deprecated: Use `RANK_BY_EMBEDDING` instead.
|
|
905
|
+
// Ranking by custom embedding model, the default way to evaluate the
|
|
906
|
+
// ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
|
|
907
|
+
// used instead.
|
|
908
|
+
BYOE = 1 [deprecated = true];
|
|
909
|
+
|
|
910
|
+
// Deprecated: Use `RANK_BY_FORMULA` instead.
|
|
911
|
+
// Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
|
|
912
|
+
// be used instead.
|
|
913
|
+
CLEARBOX = 2 [deprecated = true];
|
|
914
|
+
|
|
915
|
+
// Ranking by custom embedding model, the default way to evaluate the
|
|
916
|
+
// ranking expression.
|
|
917
|
+
RANK_BY_EMBEDDING = 3;
|
|
918
|
+
|
|
919
|
+
// Ranking by custom formula.
|
|
920
|
+
RANK_BY_FORMULA = 4;
|
|
921
|
+
}
|
|
922
|
+
|
|
792
923
|
// The relevance threshold of the search results. The higher relevance
|
|
793
924
|
// threshold is, the higher relevant results are shown and the less number of
|
|
794
925
|
// results are returned.
|
|
@@ -835,6 +966,25 @@ message SearchRequest {
|
|
|
835
966
|
// Raw search query.
|
|
836
967
|
string query = 3;
|
|
837
968
|
|
|
969
|
+
// Optional. The categories associated with a category page. Must be set for
|
|
970
|
+
// category navigation queries to achieve good search quality. The format
|
|
971
|
+
// should be the same as
|
|
972
|
+
// [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category].
|
|
973
|
+
// This field is the equivalent of the query for browse (navigation) queries.
|
|
974
|
+
// It's used by the browse model when the query is empty.
|
|
975
|
+
//
|
|
976
|
+
// If the field is empty, it will not be used by the browse model.
|
|
977
|
+
// If the field contains more than one element, only the first element will
|
|
978
|
+
// be used.
|
|
979
|
+
//
|
|
980
|
+
// To represent full path of a category, use '>' character to separate
|
|
981
|
+
// different hierarchies. If '>' is part of the category name, replace it with
|
|
982
|
+
// other character(s).
|
|
983
|
+
// For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX >
|
|
984
|
+
// 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090
|
|
985
|
+
// > Founders Edition`
|
|
986
|
+
repeated string page_categories = 63 [(google.api.field_behavior) = OPTIONAL];
|
|
987
|
+
|
|
838
988
|
// Raw image query.
|
|
839
989
|
ImageQuery image_query = 19;
|
|
840
990
|
|
|
@@ -867,6 +1017,8 @@ message SearchRequest {
|
|
|
867
1017
|
// unset.
|
|
868
1018
|
//
|
|
869
1019
|
// If this field is negative, an `INVALID_ARGUMENT` is returned.
|
|
1020
|
+
//
|
|
1021
|
+
// A large offset may be capped to a reasonable threshold.
|
|
870
1022
|
int32 offset = 6;
|
|
871
1023
|
|
|
872
1024
|
// The maximum number of results to return for OneBox.
|
|
@@ -977,10 +1129,10 @@ message SearchRequest {
|
|
|
977
1129
|
// which spell correction takes effect.
|
|
978
1130
|
SpellCorrectionSpec spell_correction_spec = 14;
|
|
979
1131
|
|
|
980
|
-
// A unique identifier for tracking visitors. For example, this
|
|
981
|
-
// implemented with an HTTP cookie, which should be able to uniquely
|
|
982
|
-
// a visitor on a single device. This unique identifier should not
|
|
983
|
-
// the visitor logs in or out of the website.
|
|
1132
|
+
// Optional. A unique identifier for tracking visitors. For example, this
|
|
1133
|
+
// could be implemented with an HTTP cookie, which should be able to uniquely
|
|
1134
|
+
// identify a visitor on a single device. This unique identifier should not
|
|
1135
|
+
// change if the visitor logs in or out of the website.
|
|
984
1136
|
//
|
|
985
1137
|
// This field should NOT have a fixed value such as `unknown_visitor`.
|
|
986
1138
|
//
|
|
@@ -991,87 +1143,13 @@ message SearchRequest {
|
|
|
991
1143
|
//
|
|
992
1144
|
// The field must be a UTF-8 encoded string with a length limit of 128
|
|
993
1145
|
// characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
|
994
|
-
string user_pseudo_id = 15;
|
|
1146
|
+
string user_pseudo_id = 15 [(google.api.field_behavior) = OPTIONAL];
|
|
995
1147
|
|
|
996
1148
|
// A specification for configuring the behavior of content search.
|
|
997
1149
|
ContentSearchSpec content_search_spec = 24;
|
|
998
1150
|
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1001
|
-
bool safe_search = 20;
|
|
1002
|
-
|
|
1003
|
-
// The user labels applied to a resource must meet the following requirements:
|
|
1004
|
-
//
|
|
1005
|
-
// * Each resource can have multiple labels, up to a maximum of 64.
|
|
1006
|
-
// * Each label must be a key-value pair.
|
|
1007
|
-
// * Keys have a minimum length of 1 character and a maximum length of 63
|
|
1008
|
-
// characters and cannot be empty. Values can be empty and have a maximum
|
|
1009
|
-
// length of 63 characters.
|
|
1010
|
-
// * Keys and values can contain only lowercase letters, numeric characters,
|
|
1011
|
-
// underscores, and dashes. All characters must use UTF-8 encoding, and
|
|
1012
|
-
// international characters are allowed.
|
|
1013
|
-
// * The key portion of a label must be unique. However, you can use the same
|
|
1014
|
-
// key with multiple resources.
|
|
1015
|
-
// * Keys must start with a lowercase letter or international character.
|
|
1016
|
-
//
|
|
1017
|
-
// See [Google Cloud
|
|
1018
|
-
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
|
1019
|
-
// for more details.
|
|
1020
|
-
map<string, string> user_labels = 22;
|
|
1021
|
-
|
|
1022
|
-
// Search as you type configuration. Only supported for the
|
|
1023
|
-
// [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1.IndustryVertical.MEDIA]
|
|
1024
|
-
// vertical.
|
|
1025
|
-
SearchAsYouTypeSpec search_as_you_type_spec = 31;
|
|
1026
|
-
|
|
1027
|
-
// Optional. Config for display feature, like match highlighting on search
|
|
1028
|
-
// results.
|
|
1029
|
-
DisplaySpec display_spec = 38 [(google.api.field_behavior) = OPTIONAL];
|
|
1030
|
-
|
|
1031
|
-
// The session resource name. Optional.
|
|
1032
|
-
//
|
|
1033
|
-
// Session allows users to do multi-turn /search API calls or coordination
|
|
1034
|
-
// between /search API calls and /answer API calls.
|
|
1035
|
-
//
|
|
1036
|
-
// Example #1 (multi-turn /search API calls):
|
|
1037
|
-
// Call /search API with the session ID generated in the first call.
|
|
1038
|
-
// Here, the previous search query gets considered in query
|
|
1039
|
-
// standing. I.e., if the first query is "How did Alphabet do in 2022?"
|
|
1040
|
-
// and the current query is "How about 2023?", the current query will
|
|
1041
|
-
// be interpreted as "How did Alphabet do in 2023?".
|
|
1042
|
-
//
|
|
1043
|
-
// Example #2 (coordination between /search API calls and /answer API calls):
|
|
1044
|
-
// Call /answer API with the session ID generated in the first call.
|
|
1045
|
-
// Here, the answer generation happens in the context of the search
|
|
1046
|
-
// results from the first search call.
|
|
1047
|
-
//
|
|
1048
|
-
// Multi-turn Search feature is currently at private GA stage. Please use
|
|
1049
|
-
// v1alpha or v1beta version instead before we launch this feature to public
|
|
1050
|
-
// GA. Or ask for allowlisting through Google Support team.
|
|
1051
|
-
string session = 41 [(google.api.resource_reference) = {
|
|
1052
|
-
type: "discoveryengine.googleapis.com/Session"
|
|
1053
|
-
}];
|
|
1054
|
-
|
|
1055
|
-
// Session specification.
|
|
1056
|
-
//
|
|
1057
|
-
// Can be used only when `session` is set.
|
|
1058
|
-
SessionSpec session_spec = 42;
|
|
1059
|
-
|
|
1060
|
-
// The relevance threshold of the search results.
|
|
1061
|
-
//
|
|
1062
|
-
// Default to Google defined threshold, leveraging a balance of
|
|
1063
|
-
// precision and recall to deliver both highly accurate results and
|
|
1064
|
-
// comprehensive coverage of relevant information.
|
|
1065
|
-
//
|
|
1066
|
-
// This feature is not supported for healthcare search.
|
|
1067
|
-
RelevanceThreshold relevance_threshold = 44;
|
|
1068
|
-
|
|
1069
|
-
// Optional. The specification for returning the relevance score.
|
|
1070
|
-
RelevanceScoreSpec relevance_score_spec = 52
|
|
1071
|
-
[(google.api.field_behavior) = OPTIONAL];
|
|
1072
|
-
|
|
1073
|
-
// The ranking expression controls the customized ranking on retrieval
|
|
1074
|
-
// documents. This overrides
|
|
1151
|
+
// Optional. The ranking expression controls the customized ranking on
|
|
1152
|
+
// retrieval documents. This overrides
|
|
1075
1153
|
// [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1.ServingConfig.ranking_expression].
|
|
1076
1154
|
// The syntax and supported features depend on the
|
|
1077
1155
|
// `ranking_expression_backend` value. If `ranking_expression_backend` is not
|
|
@@ -1160,23 +1238,109 @@ message SearchRequest {
|
|
|
1160
1238
|
// Google model to determine the keyword-based overlap between the query and
|
|
1161
1239
|
// the document.
|
|
1162
1240
|
// * `base_rank`: the default rank of the result
|
|
1163
|
-
string ranking_expression = 26;
|
|
1241
|
+
string ranking_expression = 26 [(google.api.field_behavior) = OPTIONAL];
|
|
1164
1242
|
|
|
1165
|
-
// The backend to use for the ranking expression evaluation.
|
|
1166
|
-
|
|
1167
|
-
|
|
1243
|
+
// Optional. The backend to use for the ranking expression evaluation.
|
|
1244
|
+
RankingExpressionBackend ranking_expression_backend = 53
|
|
1245
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
1168
1246
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
// ranking expression.
|
|
1173
|
-
RANK_BY_EMBEDDING = 3;
|
|
1174
|
-
// Ranking by custom formula.
|
|
1175
|
-
RANK_BY_FORMULA = 4;
|
|
1176
|
-
}
|
|
1247
|
+
// Whether to turn on safe search. This is only supported for
|
|
1248
|
+
// website search.
|
|
1249
|
+
bool safe_search = 20;
|
|
1177
1250
|
|
|
1178
|
-
// The
|
|
1179
|
-
|
|
1251
|
+
// The user labels applied to a resource must meet the following requirements:
|
|
1252
|
+
//
|
|
1253
|
+
// * Each resource can have multiple labels, up to a maximum of 64.
|
|
1254
|
+
// * Each label must be a key-value pair.
|
|
1255
|
+
// * Keys have a minimum length of 1 character and a maximum length of 63
|
|
1256
|
+
// characters and cannot be empty. Values can be empty and have a maximum
|
|
1257
|
+
// length of 63 characters.
|
|
1258
|
+
// * Keys and values can contain only lowercase letters, numeric characters,
|
|
1259
|
+
// underscores, and dashes. All characters must use UTF-8 encoding, and
|
|
1260
|
+
// international characters are allowed.
|
|
1261
|
+
// * The key portion of a label must be unique. However, you can use the same
|
|
1262
|
+
// key with multiple resources.
|
|
1263
|
+
// * Keys must start with a lowercase letter or international character.
|
|
1264
|
+
//
|
|
1265
|
+
// See [Google Cloud
|
|
1266
|
+
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
|
1267
|
+
// for more details.
|
|
1268
|
+
map<string, string> user_labels = 22;
|
|
1269
|
+
|
|
1270
|
+
// Optional. Config for natural language query understanding capabilities,
|
|
1271
|
+
// such as extracting structured field filters from the query. Refer to [this
|
|
1272
|
+
// documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries)
|
|
1273
|
+
// for more information.
|
|
1274
|
+
// If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
|
|
1275
|
+
// natural language query understanding will be done.
|
|
1276
|
+
NaturalLanguageQueryUnderstandingSpec
|
|
1277
|
+
natural_language_query_understanding_spec = 28
|
|
1278
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
1279
|
+
|
|
1280
|
+
// Search as you type configuration. Only supported for the
|
|
1281
|
+
// [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1.IndustryVertical.MEDIA]
|
|
1282
|
+
// vertical.
|
|
1283
|
+
SearchAsYouTypeSpec search_as_you_type_spec = 31;
|
|
1284
|
+
|
|
1285
|
+
// Optional. Config for display feature, like match highlighting on search
|
|
1286
|
+
// results.
|
|
1287
|
+
DisplaySpec display_spec = 38 [(google.api.field_behavior) = OPTIONAL];
|
|
1288
|
+
|
|
1289
|
+
// Optional. Crowding specifications for improving result diversity.
|
|
1290
|
+
// If multiple CrowdingSpecs are specified, crowding will be evaluated on
|
|
1291
|
+
// each unique combination of the `field` values, and max_count will be the
|
|
1292
|
+
// maximum value of `max_count` across all CrowdingSpecs.
|
|
1293
|
+
// For example, if the first CrowdingSpec has `field` = "color" and
|
|
1294
|
+
// `max_count` = 3, and the second CrowdingSpec has `field` = "size" and
|
|
1295
|
+
// `max_count` = 2, then after 3 documents that share the same color AND size
|
|
1296
|
+
// have been returned, subsequent ones should be
|
|
1297
|
+
// removed or demoted.
|
|
1298
|
+
repeated CrowdingSpec crowding_specs = 40
|
|
1299
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
1300
|
+
|
|
1301
|
+
// The session resource name. Optional.
|
|
1302
|
+
//
|
|
1303
|
+
// Session allows users to do multi-turn /search API calls or coordination
|
|
1304
|
+
// between /search API calls and /answer API calls.
|
|
1305
|
+
//
|
|
1306
|
+
// Example #1 (multi-turn /search API calls):
|
|
1307
|
+
// Call /search API with the session ID generated in the first call.
|
|
1308
|
+
// Here, the previous search query gets considered in query
|
|
1309
|
+
// standing. I.e., if the first query is "How did Alphabet do in 2022?"
|
|
1310
|
+
// and the current query is "How about 2023?", the current query will
|
|
1311
|
+
// be interpreted as "How did Alphabet do in 2023?".
|
|
1312
|
+
//
|
|
1313
|
+
// Example #2 (coordination between /search API calls and /answer API calls):
|
|
1314
|
+
// Call /answer API with the session ID generated in the first call.
|
|
1315
|
+
// Here, the answer generation happens in the context of the search
|
|
1316
|
+
// results from the first search call.
|
|
1317
|
+
//
|
|
1318
|
+
// Multi-turn Search feature is currently at private GA stage. Please use
|
|
1319
|
+
// v1alpha or v1beta version instead before we launch this feature to public
|
|
1320
|
+
// GA. Or ask for allowlisting through Google Support team.
|
|
1321
|
+
string session = 41 [(google.api.resource_reference) = {
|
|
1322
|
+
type: "discoveryengine.googleapis.com/Session"
|
|
1323
|
+
}];
|
|
1324
|
+
|
|
1325
|
+
// Session specification.
|
|
1326
|
+
//
|
|
1327
|
+
// Can be used only when `session` is set.
|
|
1328
|
+
SessionSpec session_spec = 42;
|
|
1329
|
+
|
|
1330
|
+
// The global relevance threshold of the search results.
|
|
1331
|
+
//
|
|
1332
|
+
// Defaults to Google defined threshold, leveraging a balance of
|
|
1333
|
+
// precision and recall to deliver both highly accurate results and
|
|
1334
|
+
// comprehensive coverage of relevant information.
|
|
1335
|
+
//
|
|
1336
|
+
// If more granular relevance filtering is required, use the
|
|
1337
|
+
// `relevance_filter_spec` instead.
|
|
1338
|
+
//
|
|
1339
|
+
// This feature is not supported for healthcare search.
|
|
1340
|
+
RelevanceThreshold relevance_threshold = 44;
|
|
1341
|
+
|
|
1342
|
+
// Optional. The specification for returning the relevance score.
|
|
1343
|
+
RelevanceScoreSpec relevance_score_spec = 52
|
|
1180
1344
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1181
1345
|
}
|
|
1182
1346
|
|
|
@@ -1186,65 +1350,71 @@ message SearchRequest {
|
|
|
1186
1350
|
message SearchResponse {
|
|
1187
1351
|
// Represents the search results.
|
|
1188
1352
|
message SearchResult {
|
|
1189
|
-
// [Document.id][google.cloud.discoveryengine.v1.Document.id] of the
|
|
1190
|
-
// searched [Document][google.cloud.discoveryengine.v1.Document].
|
|
1191
|
-
string id = 1;
|
|
1192
|
-
|
|
1193
|
-
// The document data snippet in the search response. Only fields that are
|
|
1194
|
-
// marked as `retrievable` are populated.
|
|
1195
|
-
Document document = 2;
|
|
1196
|
-
|
|
1197
|
-
// The chunk data in the search response if the
|
|
1198
|
-
// [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
|
|
1199
|
-
// is set to
|
|
1200
|
-
// [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
|
|
1201
|
-
Chunk chunk = 18;
|
|
1202
|
-
|
|
1203
|
-
// Output only. Google provided available scores.
|
|
1204
|
-
map<string, DoubleList> model_scores = 4
|
|
1205
|
-
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
1206
|
-
|
|
1207
1353
|
// A set of ranking signals.
|
|
1208
1354
|
message RankSignals {
|
|
1209
|
-
|
|
1355
|
+
// Custom clearbox signal represented by name and value pair.
|
|
1356
|
+
message CustomSignal {
|
|
1357
|
+
// Optional. Name of the signal.
|
|
1358
|
+
string name = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
1210
1359
|
|
|
1211
|
-
|
|
1360
|
+
// Optional. Float value representing the ranking signal (e.g. 1.25 for
|
|
1361
|
+
// BM25).
|
|
1362
|
+
float value = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
// Optional. Keyword matching adjustment.
|
|
1212
1366
|
optional float keyword_similarity_score = 1
|
|
1213
1367
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1214
|
-
|
|
1368
|
+
|
|
1369
|
+
// Optional. Semantic relevance adjustment.
|
|
1215
1370
|
optional float relevance_score = 2
|
|
1216
1371
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1217
|
-
|
|
1372
|
+
|
|
1373
|
+
// Optional. Semantic similarity adjustment.
|
|
1218
1374
|
optional float semantic_similarity_score = 3
|
|
1219
1375
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1220
|
-
|
|
1376
|
+
|
|
1377
|
+
// Optional. Predicted conversion rate adjustment as a rank.
|
|
1221
1378
|
optional float pctr_rank = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
1222
|
-
|
|
1379
|
+
|
|
1380
|
+
// Optional. Topicality adjustment as a rank.
|
|
1223
1381
|
optional float topicality_rank = 6
|
|
1224
1382
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1225
|
-
|
|
1383
|
+
|
|
1384
|
+
// Optional. Age of the document in hours.
|
|
1226
1385
|
optional float document_age = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
1227
|
-
|
|
1386
|
+
|
|
1387
|
+
// Optional. Combined custom boosts for a doc.
|
|
1228
1388
|
optional float boosting_factor = 8
|
|
1229
1389
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1230
1390
|
|
|
1231
|
-
// The default rank of the result.
|
|
1391
|
+
// Optional. The default rank of the result.
|
|
1232
1392
|
float default_rank = 32 [(google.api.field_behavior) = OPTIONAL];
|
|
1233
1393
|
|
|
1234
|
-
//
|
|
1235
|
-
message CustomSignal {
|
|
1236
|
-
// Name of the signal.
|
|
1237
|
-
string name = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
1238
|
-
// Float value representing the ranking signal (e.g. 1.25 for BM25).
|
|
1239
|
-
float value = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
// A list of custom clearbox signals.
|
|
1394
|
+
// Optional. A list of custom clearbox signals.
|
|
1243
1395
|
repeated CustomSignal custom_signals = 33
|
|
1244
1396
|
[(google.api.field_behavior) = OPTIONAL];
|
|
1245
1397
|
}
|
|
1246
1398
|
|
|
1247
|
-
//
|
|
1399
|
+
// [Document.id][google.cloud.discoveryengine.v1.Document.id] of the
|
|
1400
|
+
// searched [Document][google.cloud.discoveryengine.v1.Document].
|
|
1401
|
+
string id = 1;
|
|
1402
|
+
|
|
1403
|
+
// The document data snippet in the search response. Only fields that are
|
|
1404
|
+
// marked as `retrievable` are populated.
|
|
1405
|
+
Document document = 2;
|
|
1406
|
+
|
|
1407
|
+
// The chunk data in the search response if the
|
|
1408
|
+
// [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
|
|
1409
|
+
// is set to
|
|
1410
|
+
// [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
|
|
1411
|
+
Chunk chunk = 18;
|
|
1412
|
+
|
|
1413
|
+
// Output only. Google provided available scores.
|
|
1414
|
+
map<string, DoubleList> model_scores = 4
|
|
1415
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
1416
|
+
|
|
1417
|
+
// Optional. A set of ranking signals associated with the result.
|
|
1248
1418
|
RankSignals rank_signals = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
1249
1419
|
}
|
|
1250
1420
|
|
|
@@ -1461,6 +1631,140 @@ message SearchResponse {
|
|
|
1461
1631
|
int64 pinned_result_count = 2;
|
|
1462
1632
|
}
|
|
1463
1633
|
|
|
1634
|
+
// Information describing what natural language understanding was
|
|
1635
|
+
// done on the input query.
|
|
1636
|
+
message NaturalLanguageQueryUnderstandingInfo {
|
|
1637
|
+
// The filters that were extracted from the input query represented in a
|
|
1638
|
+
// structured form.
|
|
1639
|
+
message StructuredExtractedFilter {
|
|
1640
|
+
// Constraint expression of a string field.
|
|
1641
|
+
message StringConstraint {
|
|
1642
|
+
// Name of the string field as defined in the schema.
|
|
1643
|
+
string field_name = 1;
|
|
1644
|
+
|
|
1645
|
+
// Values of the string field. The record will only be returned if the
|
|
1646
|
+
// field value matches one of the values specified here.
|
|
1647
|
+
repeated string values = 2;
|
|
1648
|
+
|
|
1649
|
+
// Identifies the keywords within the search query that match a filter.
|
|
1650
|
+
string query_segment = 3;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
// Constraint expression of a number field. Example: price < 100.
|
|
1654
|
+
message NumberConstraint {
|
|
1655
|
+
// The comparison operation that was performed.
|
|
1656
|
+
enum Comparison {
|
|
1657
|
+
// Undefined comparison operator.
|
|
1658
|
+
COMPARISON_UNSPECIFIED = 0;
|
|
1659
|
+
|
|
1660
|
+
// Denotes equality `=` operator.
|
|
1661
|
+
EQUALS = 1;
|
|
1662
|
+
|
|
1663
|
+
// Denotes less than or equal to `<=` operator.
|
|
1664
|
+
LESS_THAN_EQUALS = 2;
|
|
1665
|
+
|
|
1666
|
+
// Denotes less than `<` operator.
|
|
1667
|
+
LESS_THAN = 3;
|
|
1668
|
+
|
|
1669
|
+
// Denotes greater than or equal to `>=` operator.
|
|
1670
|
+
GREATER_THAN_EQUALS = 4;
|
|
1671
|
+
|
|
1672
|
+
// Denotes greater than `>` operator.
|
|
1673
|
+
GREATER_THAN = 5;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
// Name of the numerical field as defined in the schema.
|
|
1677
|
+
string field_name = 1;
|
|
1678
|
+
|
|
1679
|
+
// The comparison operation performed between the field value and the
|
|
1680
|
+
// value specified in the constraint.
|
|
1681
|
+
Comparison comparison = 2;
|
|
1682
|
+
|
|
1683
|
+
// The value specified in the numerical constraint.
|
|
1684
|
+
double value = 3;
|
|
1685
|
+
|
|
1686
|
+
// Identifies the keywords within the search query that match a filter.
|
|
1687
|
+
string query_segment = 4;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
// Constraint of a geolocation field.
|
|
1691
|
+
// Name of the geolocation field as defined in the schema.
|
|
1692
|
+
message GeolocationConstraint {
|
|
1693
|
+
// The name of the geolocation field as defined in the schema.
|
|
1694
|
+
string field_name = 1;
|
|
1695
|
+
|
|
1696
|
+
// The reference address that was inferred from the input query. The
|
|
1697
|
+
// proximity of the reference address to the geolocation field will be
|
|
1698
|
+
// used to filter the results.
|
|
1699
|
+
string address = 2;
|
|
1700
|
+
|
|
1701
|
+
// The latitude of the geolocation inferred from the input query.
|
|
1702
|
+
double latitude = 4;
|
|
1703
|
+
|
|
1704
|
+
// The longitude of the geolocation inferred from the input query.
|
|
1705
|
+
double longitude = 5;
|
|
1706
|
+
|
|
1707
|
+
// The radius in meters around the address. The record is returned if
|
|
1708
|
+
// the location of the geolocation field is within the radius.
|
|
1709
|
+
float radius_in_meters = 3;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
// Logical `And` operator.
|
|
1713
|
+
message AndExpression {
|
|
1714
|
+
// The expressions that were ANDed together.
|
|
1715
|
+
repeated Expression expressions = 1;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
// Logical `Or` operator.
|
|
1719
|
+
message OrExpression {
|
|
1720
|
+
// The expressions that were ORed together.
|
|
1721
|
+
repeated Expression expressions = 1;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
// The expression denoting the filter that was extracted from the input
|
|
1725
|
+
// query.
|
|
1726
|
+
message Expression {
|
|
1727
|
+
// The expression type.
|
|
1728
|
+
oneof expr {
|
|
1729
|
+
// String constraint expression.
|
|
1730
|
+
StringConstraint string_constraint = 1;
|
|
1731
|
+
|
|
1732
|
+
// Numerical constraint expression.
|
|
1733
|
+
NumberConstraint number_constraint = 2;
|
|
1734
|
+
|
|
1735
|
+
// Geolocation constraint expression.
|
|
1736
|
+
GeolocationConstraint geolocation_constraint = 3;
|
|
1737
|
+
|
|
1738
|
+
// Logical "And" compound operator connecting multiple expressions.
|
|
1739
|
+
AndExpression and_expr = 4;
|
|
1740
|
+
|
|
1741
|
+
// Logical "Or" compound operator connecting multiple expressions.
|
|
1742
|
+
OrExpression or_expr = 5;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
// The expression denoting the filter that was extracted from the input
|
|
1747
|
+
// query in a structured form. It can be a simple expression denoting a
|
|
1748
|
+
// single string, numerical or geolocation constraint or a compound
|
|
1749
|
+
// expression which is a combination of multiple expressions connected
|
|
1750
|
+
// using logical (OR and AND) operators.
|
|
1751
|
+
Expression expression = 1;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
// The filters that were extracted from the input query.
|
|
1755
|
+
string extracted_filters = 1;
|
|
1756
|
+
|
|
1757
|
+
// Rewritten input query minus the extracted filters.
|
|
1758
|
+
string rewritten_query = 2;
|
|
1759
|
+
|
|
1760
|
+
// The classified intents from the input query.
|
|
1761
|
+
repeated string classified_intents = 5;
|
|
1762
|
+
|
|
1763
|
+
// The filters that were extracted from the input query represented in a
|
|
1764
|
+
// structured form.
|
|
1765
|
+
StructuredExtractedFilter structured_extracted_filter = 3;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1464
1768
|
// Information about the session.
|
|
1465
1769
|
message SessionInfo {
|
|
1466
1770
|
// Name of the session.
|
|
@@ -1478,6 +1782,18 @@ message SearchResponse {
|
|
|
1478
1782
|
string query_id = 2;
|
|
1479
1783
|
}
|
|
1480
1784
|
|
|
1785
|
+
// Semantic state of the search response.
|
|
1786
|
+
enum SemanticState {
|
|
1787
|
+
// Default value. Should not be used.
|
|
1788
|
+
SEMANTIC_STATE_UNSPECIFIED = 0;
|
|
1789
|
+
|
|
1790
|
+
// Semantic search was disabled for this search response.
|
|
1791
|
+
DISABLED = 1;
|
|
1792
|
+
|
|
1793
|
+
// Semantic search was enabled for this search response.
|
|
1794
|
+
ENABLED = 2;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1481
1797
|
// A list of matched documents. The order represents the ranking.
|
|
1482
1798
|
repeated SearchResult results = 1;
|
|
1483
1799
|
|
|
@@ -1526,6 +1842,12 @@ message SearchResponse {
|
|
|
1526
1842
|
// Query expansion information for the returned results.
|
|
1527
1843
|
QueryExpansionInfo query_expansion_info = 14;
|
|
1528
1844
|
|
|
1845
|
+
// Output only. Natural language query understanding information for the
|
|
1846
|
+
// returned results.
|
|
1847
|
+
NaturalLanguageQueryUnderstandingInfo
|
|
1848
|
+
natural_language_query_understanding_info = 15
|
|
1849
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
1850
|
+
|
|
1529
1851
|
// Session information.
|
|
1530
1852
|
//
|
|
1531
1853
|
// Only set if
|
|
@@ -1535,4 +1857,7 @@ message SearchResponse {
|
|
|
1535
1857
|
|
|
1536
1858
|
// Promotions for site search.
|
|
1537
1859
|
repeated SearchLinkPromotion search_link_promotions = 23;
|
|
1860
|
+
|
|
1861
|
+
// Output only. Indicates the semantic state of the search response.
|
|
1862
|
+
SemanticState semantic_state = 36 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
1538
1863
|
}
|