Skip to content

Commit eb5ac9d

Browse files
Google APIscopybara-github
authored andcommitted
feat: allow users to specify id field in documents gcs import
feat: add LRO API for schema service docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 534894398
1 parent eb2d1f1 commit eb5ac9d

3 files changed

Lines changed: 57 additions & 3 deletions

File tree

google/cloud/discoveryengine/v1beta/discoveryengine_v1beta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ http:
5555
additional_bindings:
5656
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}'
5757
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}'
58+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}'
5859
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}'
5960
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}'
6061
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}'
@@ -65,6 +66,7 @@ http:
6566
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations'
6667
additional_bindings:
6768
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations'
69+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations'
6870
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations'
6971
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations'
7072
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations'

google/cloud/discoveryengine/v1beta/import_config.proto

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,60 @@ message ImportDocumentsRequest {
269269
// be imported. Defaults to
270270
// [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
271271
ReconciliationMode reconciliation_mode = 6;
272+
273+
// Whether to automatically generate IDs for the documents if absent.
274+
//
275+
// If set to `true`,
276+
// [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
277+
// automatically generated based on the hash of the payload, where IDs may not
278+
// be consistent during multiple imports. In which case
279+
// [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
280+
// is highly recommended to avoid duplicate contents. If unset or set to
281+
// `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
282+
// have to be specified using
283+
// [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
284+
// otherwises, documents without IDs will fail to be imported.
285+
//
286+
// Only set this field when using
287+
// [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
288+
// [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
289+
// when
290+
// [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
291+
// or
292+
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
293+
// is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
294+
bool auto_generate_ids = 8;
295+
296+
// The field in the Cloud Storage and BigQuery sources that indicates the
297+
// unique IDs of the documents.
298+
//
299+
// For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
300+
// key of the JSON field. For instance, `my_id` for JSON `{"my_id":
301+
// "some_uuid"}`. For
302+
// [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource] it is
303+
// the column name of the BigQuery table where the unique ids are stored.
304+
//
305+
// The values of the JSON field or the BigQuery column will be used as the
306+
// [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. The JSON
307+
// field or the BigQuery column must be of string type, and the values must be
308+
// set as valid strings conform to
309+
// [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
310+
// Otherwise, documents without valid IDs will fail to be imported.
311+
//
312+
// Only set this field when using
313+
// [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
314+
// [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
315+
// when
316+
// [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
317+
// or
318+
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
319+
// is `custom`. And only set this field when
320+
// [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids]
321+
// is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
322+
//
323+
// If it is unset, a default value `_id` is used when importing from the
324+
// allowed data sources.
325+
string id_field = 9;
272326
}
273327

274328
// Response of the

google/cloud/discoveryengine/v1beta/search_service.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,7 @@ message SearchRequest {
398398

399399
// Additional search parameters.
400400
//
401-
// For
402-
// [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
403-
// vertical, supported values are:
401+
// For public website search only, supported values are:
404402
//
405403
// * `user_country_code`: string. Default empty. If set to non-empty, results
406404
// are restricted or boosted based on the location provided.

0 commit comments

Comments
 (0)