@@ -103,6 +103,7 @@ message SearchRequest {
103103 // * "rating"
104104 // * "ratingCount"
105105 // * "attributes.key"
106+ // * "inventory(place_id,price)"
106107 string key = 1 [(google.api.field_behavior ) = REQUIRED ];
107108
108109 // Set only if values should be bucketized into intervals. Must be set
@@ -349,14 +350,39 @@ message SearchRequest {
349350 bool pin_unexpanded_results = 2 ;
350351 }
351352
353+ // The search mode of each search request.
354+ enum SearchMode {
355+ // Default value. In this case both product search and faceted search will
356+ // be performed. Both [SearchResponse.SearchResult] and
357+ // [SearchResponse.Facet] will be returned.
358+ SEARCH_MODE_UNSPECIFIED = 0 ;
359+
360+ // Only product search will be performed. The faceted search will be
361+ // disabled.
362+ //
363+ // Only [SearchResponse.SearchResult] will be returned.
364+ // [SearchResponse.Facet] will not be returned, even if
365+ // [SearchRequest.facet_specs][google.cloud.retail.v2.SearchRequest.facet_specs]
366+ // or
367+ // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
368+ // is set.
369+ PRODUCT_SEARCH_ONLY = 1 ;
370+
371+ // Only faceted search will be performed. The product search will be
372+ // disabled.
373+ //
374+ // When in this mode, one or both of [SearchRequest.facet_spec][] and
375+ // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2.SearchRequest.dynamic_facet_spec]
376+ // should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
377+ // [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
378+ // will not be returned.
379+ FACETED_SEARCH_ONLY = 2 ;
380+ }
381+
352382 // Required. The resource name of the search engine placement, such as
353383 // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
354- // This field is used to identify the set of models that will be used to make
355- // the search.
356- //
357- // We currently support one placement with the following ID:
358- //
359- // * `default_search`.
384+ // This field is used to identify the serving configuration name and the set
385+ // of models that will be used to make the search.
360386 string placement = 1 [(google.api.field_behavior ) = REQUIRED ];
361387
362388 // The branch resource name, such as
@@ -413,7 +439,8 @@ message SearchRequest {
413439
414440 // The filter syntax consists of an expression language for constructing a
415441 // predicate from one or more fields of the products being filtered. Filter
416- // expression is case-sensitive.
442+ // expression is case-sensitive. See more details at this [user
443+ // guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
417444 //
418445 // If this field is unrecognizable, an INVALID_ARGUMENT is returned.
419446 string filter = 10 ;
@@ -431,7 +458,9 @@ message SearchRequest {
431458
432459 // The order in which products are returned. Products can be ordered by
433460 // a field in an [Product][google.cloud.retail.v2.Product] object. Leave it
434- // unset if ordered by relevance. OrderBy expression is case-sensitive.
461+ // unset if ordered by relevance. OrderBy expression is case-sensitive. See
462+ // more details at this [user
463+ // guide](https://cloud.google.com/retail/docs/filter-and-order#order).
435464 //
436465 // If this field is unrecognizable, an INVALID_ARGUMENT is returned.
437466 string order_by = 11 ;
@@ -449,11 +478,19 @@ message SearchRequest {
449478 // support team if you are interested in using dynamic facet feature.
450479 DynamicFacetSpec dynamic_facet_spec = 21 ;
451480
452- // Boost specification to boost certain products.
481+ // Boost specification to boost certain products. See more details at this
482+ // [user guide](https://cloud.google.com/retail/docs/boosting).
483+ //
484+ // Notice that if both [ServingConfig.boost_control_ids][] and
485+ // [SearchRequest.boost_spec] are set, the boost conditions from both places
486+ // are evaluated. If a search request matches multiple boost conditions,
487+ // the final boost score is equal to the sum of the boost scores from all
488+ // matched boost conditions.
453489 BoostSpec boost_spec = 13 ;
454490
455491 // The query expansion specification that specifies the conditions under which
456- // query expansion will occur.
492+ // query expansion will occur. See more details at this [user
493+ // guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
457494 QueryExpansionSpec query_expansion_spec = 14 ;
458495
459496 // The keys to fetch and rollup the matching
@@ -476,6 +513,7 @@ message SearchRequest {
476513 // * price
477514 // * originalPrice
478515 // * discount
516+ // * inventory(place_id,price)
479517 // * attributes.key, where key is any key in the
480518 // [Product.attributes][google.cloud.retail.v2.Product.attributes] map.
481519 // * pickupInStore.id, where id is any
@@ -532,6 +570,10 @@ message SearchRequest {
532570 // instance, a special sale page may have the category hierarchy:
533571 // "pageCategories" : ["Sales > 2017 Black Friday Deals"].
534572 repeated string page_categories = 23 ;
573+
574+ // The search mode of the search request. If not specified, a single search
575+ // request triggers both product search and faceted search.
576+ SearchMode search_mode = 31 ;
535577}
536578
537579// Response message for
@@ -646,7 +688,8 @@ message SearchResponse {
646688 bool expanded_query = 1 ;
647689
648690 // Number of pinned results. This field will only be set when expansion
649- // happens and [SearchRequest.query_expansion_spec.pin_unexpanded_results][]
691+ // happens and
692+ // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
650693 // is set to true.
651694 int64 pinned_result_count = 2 ;
652695 }
0 commit comments