1// Copyright 2022 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.discoveryengine.v1alpha; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/struct.proto"; 22 23option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; 24option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; 25option java_multiple_files = true; 26option java_outer_classname = "SchemaProto"; 27option java_package = "com.google.cloud.discoveryengine.v1alpha"; 28option objc_class_prefix = "DISCOVERYENGINE"; 29option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; 30option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; 31 32// Defines the structure and layout of a type of document data. 33message Schema { 34 option (google.api.resource) = { 35 type: "discoveryengine.googleapis.com/Schema" 36 pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}" 37 pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}" 38 }; 39 40 // Schema representation. One of 41 // [struct_schema][google.cloud.discoveryengine.v1alpha.Schema.struct_schema] 42 // or [json_schema][google.cloud.discoveryengine.v1alpha.Schema.json_schema] 43 // should be provided otherwise an `INVALID_ARGUMENT` error is thrown. 44 oneof schema { 45 // The structured representation of the schema. 46 google.protobuf.Struct struct_schema = 2; 47 48 // The JSON representation of the schema. 49 string json_schema = 3; 50 } 51 52 // Immutable. The full resource name of the schema, in the format of 53 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. 54 // 55 // This field must be a UTF-8 encoded string with a length limit of 1024 56 // characters. 57 string name = 1 [(google.api.field_behavior) = IMMUTABLE]; 58 59 // Output only. Configurations for fields of the schema. 60 repeated FieldConfig field_configs = 4 61 [(google.api.field_behavior) = OUTPUT_ONLY]; 62} 63 64// Configurations for fields of a schema. For example, configuring a field is 65// indexable, or searchable. 66message FieldConfig { 67 // Field value type in the Schema. 68 enum FieldType { 69 // Field type is unspecified. 70 FIELD_TYPE_UNSPECIFIED = 0; 71 72 // Field value type is Object. 73 OBJECT = 1; 74 75 // Field value type is String. 76 STRING = 2; 77 78 // Field value type is Number. 79 NUMBER = 3; 80 81 // Field value type is Integer. 82 INTEGER = 4; 83 84 // Field value type is Boolean. 85 BOOLEAN = 5; 86 87 // Field value type is Geolocation. 88 GEOLOCATION = 6; 89 90 // Field value type is Datetime. 91 DATETIME = 7; 92 } 93 94 // The setting of Indexable options in schema. 95 enum IndexableOption { 96 // Value used when unset. 97 INDEXABLE_OPTION_UNSPECIFIED = 0; 98 99 // Indexable option enabled for a schema field. 100 INDEXABLE_ENABLED = 1; 101 102 // Indexable option disabled for a schema field. 103 INDEXABLE_DISABLED = 2; 104 } 105 106 // The status of the dynamic facetable option of a schema field. 107 enum DynamicFacetableOption { 108 // Value used when unset. 109 DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; 110 111 // Dynamic facetable option enabled for a schema field. 112 DYNAMIC_FACETABLE_ENABLED = 1; 113 114 // Dynamic facetable option disabled for a schema field. 115 DYNAMIC_FACETABLE_DISABLED = 2; 116 } 117 118 // The setting of Searchable options in schema. 119 enum SearchableOption { 120 // Value used when unset. 121 SEARCHABLE_OPTION_UNSPECIFIED = 0; 122 123 // Searchable option enabled for a schema field. 124 SEARCHABLE_ENABLED = 1; 125 126 // Searchable option disabled for a schema field. 127 SEARCHABLE_DISABLED = 2; 128 } 129 130 // The setting of Retrievable options in schema. 131 enum RetrievableOption { 132 // Value used when unset. 133 RETRIEVABLE_OPTION_UNSPECIFIED = 0; 134 135 // Retrievable option enabled for a schema field. 136 RETRIEVABLE_ENABLED = 1; 137 138 // Retrievable option disabled for a schema field. 139 RETRIEVABLE_DISABLED = 2; 140 } 141 142 // The setting of Completable options in schema. 143 enum CompletableOption { 144 // Value used when unset. 145 COMPLETABLE_OPTION_UNSPECIFIED = 0; 146 147 // Completable option enabled for a schema field. 148 COMPLETABLE_ENABLED = 1; 149 150 // Completable option disabled for a schema field. 151 COMPLETABLE_DISABLED = 2; 152 } 153 154 // Sets the filterable option for schema fields. 155 enum FilterableOption { 156 // Value used when unset. 157 FILTERABLE_OPTION_UNSPECIFIED = 0; 158 159 // Filterable option enabled for a schema field. 160 FILTERABLE_ENABLED = 1; 161 162 // Filterable option disabled for a schema field. 163 FILTERABLE_DISABLED = 2; 164 } 165 166 // Optional source of the advanced site search field. 167 enum AdvancedSiteSearchDataSource { 168 // Value used when unset. 169 ADVANCED_SITE_SEARCH_DATA_SOURCE_UNSPECIFIED = 0; 170 171 // Retrieve value from meta tag. 172 METATAGS = 1; 173 174 // Retrieve value from page map. 175 PAGEMAP = 2; 176 } 177 178 // Required. Field path of the schema field. 179 // For example: `title`, `description`, `release_info.release_year`. 180 string field_path = 1 [(google.api.field_behavior) = REQUIRED]; 181 182 // Output only. Raw type of the field. 183 FieldType field_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 184 185 // If 186 // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] 187 // is 188 // [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED], 189 // field values are indexed so that it can be filtered or faceted in 190 // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]. 191 // 192 // If 193 // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] 194 // is unset, the server behavior defaults to 195 // [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED] 196 // for fields that support setting indexable options. For those fields that do 197 // not support setting indexable options, such as `object` and `boolean` and 198 // key properties, the server will skip 199 // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] 200 // setting, and setting 201 // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] 202 // for those fields will throw `INVALID_ARGUMENT` error. 203 IndexableOption indexable_option = 3; 204 205 // If 206 // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] 207 // is 208 // [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED], 209 // field values are available for dynamic facet. Could only be 210 // [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] 211 // if 212 // [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] 213 // is 214 // [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]. 215 // Otherwise, an `INVALID_ARGUMENT` error will be returned. 216 // 217 // If 218 // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] 219 // is unset, the server behavior defaults to 220 // [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] 221 // for fields that support setting dynamic facetable options. For those fields 222 // that do not support setting dynamic facetable options, such as `object` and 223 // `boolean`, the server will skip dynamic facetable option setting, and 224 // setting 225 // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] 226 // for those fields will throw `INVALID_ARGUMENT` error. 227 DynamicFacetableOption dynamic_facetable_option = 4; 228 229 // If 230 // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] 231 // is 232 // [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED], 233 // field values are searchable by text queries in 234 // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]. 235 // 236 // If 237 // [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED] 238 // but field type is numerical, field values will not be searchable by text 239 // queries in 240 // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search], 241 // as there are no text values associated to numerical fields. 242 // 243 // If 244 // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] 245 // is unset, the server behavior defaults to 246 // [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED] 247 // for fields that support setting searchable options. Only `string` fields 248 // that have no key property mapping support setting 249 // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]. 250 // 251 // For those fields that do not support setting searchable options, the server 252 // will skip searchable option setting, and setting 253 // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] 254 // for those fields will throw `INVALID_ARGUMENT` error. 255 SearchableOption searchable_option = 5; 256 257 // If 258 // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] 259 // is 260 // [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED], 261 // field values are included in the search results. 262 // 263 // If 264 // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] 265 // is unset, the server behavior defaults to 266 // [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED] 267 // for fields that support setting retrievable options. For those fields 268 // that do not support setting retrievable options, such as `object` and 269 // `boolean`, the server will skip retrievable option setting, and setting 270 // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] 271 // for those fields will throw `INVALID_ARGUMENT` error. 272 RetrievableOption retrievable_option = 6; 273 274 // If 275 // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] 276 // is 277 // [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED], 278 // field values are directly used and returned as suggestions for Autocomplete 279 // in 280 // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]. 281 // 282 // If 283 // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] 284 // is unset, the server behavior defaults to 285 // [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED] 286 // for fields that support setting completable options, which are just 287 // `string` fields. For those fields that do not support setting completable 288 // options, the server will skip completable option setting, and setting 289 // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] 290 // for those fields will throw `INVALID_ARGUMENT` error. 291 CompletableOption completable_option = 8; 292 293 // If 294 // [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] 295 // is 296 // [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED], 297 // field values are filterable by filter expression in 298 // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. 299 // 300 // If 301 // [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED] 302 // but the field type is numerical, field values are not filterable by text 303 // queries in 304 // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. 305 // Only textual fields are supported. 306 // 307 // If 308 // [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] 309 // is unset, the default setting is 310 // [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED] 311 // for fields that support setting filterable options. 312 // 313 // When a field set to [FILTERABLE_DISABLED] is filtered, a warning is 314 // generated and an empty result is returned. 315 FilterableOption recs_filterable_option = 9; 316 317 // Output only. Type of the key property that this field is mapped to. Empty 318 // string if this is not annotated as mapped to a key property. 319 // 320 // Example types are `title`, `description`. Full list is defined 321 // by `keyPropertyMapping` in the schema field annotation. 322 // 323 // If the schema field has a `KeyPropertyMapping` annotation, 324 // `indexable_option` and `searchable_option` of this field cannot be 325 // modified. 326 string key_property_type = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 327 328 // If this field is set, only the corresponding source will be indexed for 329 // this field. Otherwise, the values from different sources are merged. 330 // 331 // Assuming a page with `<author, a>` in meta tag, and `<author, b>` in page 332 // map: 333 // if this enum is set to METATAGS, we will only index `<author, a>`; 334 // if this enum is not set, we will merge them and index `<author, [a, b]>`. 335 repeated AdvancedSiteSearchDataSource advanced_site_search_data_sources = 10; 336} 337