Class: Google::Cloud::Retail::V2::SearchResponse

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/retail/v2/search_service.rb

Overview

Response message for SearchService.Search method.

Defined Under Namespace

Classes: ConversationalSearchResult, Facet, QueryExpansionInfo, SearchResult, TileNavigationResult

Instance Attribute Summary collapse

Instance Attribute Details

#applied_controls::Array<::String>

Returns The fully qualified resource name of applied controls.

Returns:

  • (::Array<::String>)

    The fully qualified resource name of applied controls.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#attribution_token::String

Returns A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

Returns:

  • (::String)

    A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#conversational_search_result::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult

Returns This field specifies all related information that is needed on client side for UI rendering of conversational retail search.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#corrected_query::String

Returns Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

Returns:

  • (::String)

    Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#experiment_info::Array<::Google::Cloud::Retail::V2::ExperimentInfo>

Returns Metadata related to A/B testing [Experiment][] associated with this response. Only exists when an experiment is triggered.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#facets::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet>

Returns Results of facets requested by user.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#invalid_condition_boost_specs::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>

Returns The invalid SearchRequest.BoostSpec.condition_boost_specs that are not applied during serving.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#next_page_token::String

Returns A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Returns:

  • (::String)

    A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#query_expansion_info::Google::Cloud::Retail::V2::SearchResponse::QueryExpansionInfo

Returns Query expansion information for the returned results.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#redirect_uri::String

Returns The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.

Returns:

  • (::String)

    The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#results::Array<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>

Returns A list of matched items. The order represents the ranking.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#tile_navigation_result::Google::Cloud::Retail::V2::SearchResponse::TileNavigationResult

Returns This field specifies all related information for tile navigation that will be used in client side.

Returns:



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#total_size::Integer

Returns The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

Returns:

  • (::Integer)

    The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'proto_docs/google/cloud/retail/v2/search_service.rb', line 927

class SearchResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
  #     {::Google::Cloud::Retail::V2::Product Product}.
  # @!attribute [rw] product
  #   @return [::Google::Cloud::Retail::V2::Product]
  #     The product data snippet in the search response. Only
  #     {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
  #     populated.
  #
  #     {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
  #     product variants that match the search query. If there are multiple
  #     product variants matching the query, top 5 most relevant product variants
  #     are returned and ordered by relevancy.
  #
  #     If relevancy can be deternmined, use
  #     {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
  #     to look up matched product variants fields. If relevancy cannot be
  #     determined, e.g. when searching "shoe" all products in a shoe product can
  #     be a match, 5 product variants are returned but order is meaningless.
  # @!attribute [rw] matching_variant_count
  #   @return [::Integer]
  #     The count of matched
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product}s.
  # @!attribute [rw] matching_variant_fields
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
  #     If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
  #     map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
  #     matched. The key is the
  #     {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
  #     mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
  #     matched attributes cannot be determined, this map will be empty.
  #
  #     For example, a key "sku1" with field mask
  #     "products.color_info" indicates there is a match between
  #     "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
  # @!attribute [rw] variant_rollup_values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
  #     The rollup matching
  #     {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
  #     the
  #     {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
  #     The values are the merged and de-duplicated
  #     {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
  #     rollup values are respect filter. For example, when filtering by
  #     "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
  #     returned.
  #
  #     For textual and numerical attributes, the rollup values is a list of
  #     string or double values with type
  #     {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
  #     there are two variants with colors "red" and "blue", the rollup values
  #     are
  #
  #         { key: "colorFamilies"
  #           value {
  #             list_value {
  #               values { string_value: "red" }
  #               values { string_value: "blue" }
  #              }
  #           }
  #         }
  #
  #     For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup
  #     values is a double value with type
  #     {::Google::Protobuf::Value google.protobuf.Value}. For example,
  #     `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
  #     are 10 variants in this product are available in the store "store1".
  # @!attribute [rw] personal_labels
  #   @return [::Array<::String>]
  #     Specifies previous events related to this product for this user based on
  #     {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same
  #     {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id}
  #     or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}.
  #
  #     This is set only when
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode}
  #     is
  #     {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}.
  #
  #     Possible values:
  #
  #     * `purchased`: Indicates that this product has been purchased before.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::FieldMask]
    class MatchingVariantFieldsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Protobuf::Value]
    class VariantRollupValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colorFamilies" or "price" or
  #     "attributes.attr1".
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colorFamilies".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::Retail::V2::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price".
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    # @!attribute [rw] min_value
    #   @return [::Float]
    #     The minimum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    # @!attribute [rw] max_value
    #   @return [::Float]
    #     The maximum value in the
    #     {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}.
    #     Only supported on numerical facets and returned if
    #     {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max}
    #     is true.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # This field specifies all related information that is needed on client
  # side for UI rendering of conversational retail search.
  # @!attribute [rw] conversation_id
  #   @return [::String]
  #     Conversation UUID. This field will be stored in client side storage to
  #     maintain the conversation session with server and will be used for next
  #     search request's
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id}
  #     to restore conversation state in server.
  # @!attribute [rw] refined_query
  #   @return [::String]
  #     The current refined query for the conversational search. This field
  #     will be used in customer UI that the query in the search bar should be
  #     replaced with the refined query. For example, if
  #     {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is
  #     `dress` and next
  #     {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer}
  #     is `red color`, which does not match any product attribute value filters,
  #     the refined query will be `dress, red color`.
  # @!attribute [rw] additional_filters
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>]
  #     This field is deprecated but will be kept for backward compatibility.
  #     There is expected to have only one additional filter and the value will
  #     be the same to the same as field `additional_filter`.
  # @!attribute [rw] followup_question
  #   @return [::String]
  #     The follow-up question. e.g., `What is the color?`
  # @!attribute [rw] suggested_answers
  #   @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>]
  #     The answer options provided to client for the follow-up question.
  # @!attribute [rw] additional_filter
  #   @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter]
  #     This is the incremental additional filters implied from the current
  #     user answer. User should add the suggested addition filters to the
  #     previous
  #     {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter},  and
  #     use the merged filter in the follow up search request.
  class ConversationalSearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Suggested answers to the follow-up question.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class SuggestedAnswer
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Additional filter that client side need to apply.
    # @!attribute [rw] product_attribute_value
    #   @return [::Google::Cloud::Retail::V2::ProductAttributeValue]
    #     Product attribute value, including an attribute key and an
    #     attribute value. Other types can be added here in the future.
    class AdditionalFilter
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # This field specifies all related information for tile navigation that will
  # be used in client side.
  # @!attribute [rw] tiles
  #   @return [::Array<::Google::Cloud::Retail::V2::Tile>]
  #     The current tiles that are used for tile navigation, sorted by
  #     engagement.
  class TileNavigationResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end