Class SearchResponse

  • All Implemented Interfaces:
    SearchResponseOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class SearchResponse
    extends com.google.protobuf.GeneratedMessageV3
    implements SearchResponseOrBuilder
     Response message for
     [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
     method.
     
    Protobuf type google.cloud.retail.v2alpha.SearchResponse
    See Also:
    Serialized Form
    • Field Detail

      • TOTAL_SIZE_FIELD_NUMBER

        public static final int TOTAL_SIZE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • CORRECTED_QUERY_FIELD_NUMBER

        public static final int CORRECTED_QUERY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ATTRIBUTION_TOKEN_FIELD_NUMBER

        public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER
        See Also:
        Constant Field Values
      • NEXT_PAGE_TOKEN_FIELD_NUMBER

        public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER
        See Also:
        Constant Field Values
      • QUERY_EXPANSION_INFO_FIELD_NUMBER

        public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REDIRECT_URI_FIELD_NUMBER

        public static final int REDIRECT_URI_FIELD_NUMBER
        See Also:
        Constant Field Values
      • APPLIED_CONTROLS_FIELD_NUMBER

        public static final int APPLIED_CONTROLS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER

        public static final int INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EXPERIMENT_INFO_FIELD_NUMBER

        public static final int EXPERIMENT_INFO_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getResultsCount

        public int getResultsCount()
         A list of matched items. The order represents the ranking.
         
        repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1;
        Specified by:
        getResultsCount in interface SearchResponseOrBuilder
      • getFacetsCount

        public int getFacetsCount()
         Results of facets requested by user.
         
        repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2;
        Specified by:
        getFacetsCount in interface SearchResponseOrBuilder
      • getTotalSize

        public int getTotalSize()
         The estimated total count of matched items irrespective of pagination. The
         count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
         returned by pagination may be less than the
         [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
         matches.
         
        int32 total_size = 3;
        Specified by:
        getTotalSize in interface SearchResponseOrBuilder
        Returns:
        The totalSize.
      • getCorrectedQuery

        public String getCorrectedQuery()
         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.
         
        string corrected_query = 4;
        Specified by:
        getCorrectedQuery in interface SearchResponseOrBuilder
        Returns:
        The correctedQuery.
      • getCorrectedQueryBytes

        public com.google.protobuf.ByteString getCorrectedQueryBytes()
         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.
         
        string corrected_query = 4;
        Specified by:
        getCorrectedQueryBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for correctedQuery.
      • getAttributionToken

        public String getAttributionToken()
         A unique search token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         search, which enables accurate attribution of search model performance.
         
        string attribution_token = 5;
        Specified by:
        getAttributionToken in interface SearchResponseOrBuilder
        Returns:
        The attributionToken.
      • getAttributionTokenBytes

        public com.google.protobuf.ByteString getAttributionTokenBytes()
         A unique search token. This should be included in the
         [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
         search, which enables accurate attribution of search model performance.
         
        string attribution_token = 5;
        Specified by:
        getAttributionTokenBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for attributionToken.
      • getNextPageToken

        public String getNextPageToken()
         A token that can be sent as
         [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
         to retrieve the next page. If this field is omitted, there are no
         subsequent pages.
         
        string next_page_token = 6;
        Specified by:
        getNextPageToken in interface SearchResponseOrBuilder
        Returns:
        The nextPageToken.
      • getNextPageTokenBytes

        public com.google.protobuf.ByteString getNextPageTokenBytes()
         A token that can be sent as
         [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
         to retrieve the next page. If this field is omitted, there are no
         subsequent pages.
         
        string next_page_token = 6;
        Specified by:
        getNextPageTokenBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for nextPageToken.
      • hasQueryExpansionInfo

        public boolean hasQueryExpansionInfo()
         Query expansion information for the returned results.
         
        .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7;
        Specified by:
        hasQueryExpansionInfo in interface SearchResponseOrBuilder
        Returns:
        Whether the queryExpansionInfo field is set.
      • getRedirectUri

        public String getRedirectUri()
         The URI of a customer-defined redirect page. If redirect action is
         triggered, no search is performed, and only
         [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
         [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
         are set in the response.
         
        string redirect_uri = 10;
        Specified by:
        getRedirectUri in interface SearchResponseOrBuilder
        Returns:
        The redirectUri.
      • getRedirectUriBytes

        public com.google.protobuf.ByteString getRedirectUriBytes()
         The URI of a customer-defined redirect page. If redirect action is
         triggered, no search is performed, and only
         [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
         [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
         are set in the response.
         
        string redirect_uri = 10;
        Specified by:
        getRedirectUriBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for redirectUri.
      • getAppliedControlsList

        public com.google.protobuf.ProtocolStringList getAppliedControlsList()
         The fully qualified resource name of applied
         [controls](https://cloud.google.com/retail/docs/serving-control-rules).
         
        repeated string applied_controls = 12;
        Specified by:
        getAppliedControlsList in interface SearchResponseOrBuilder
        Returns:
        A list containing the appliedControls.
      • getAppliedControlsCount

        public int getAppliedControlsCount()
         The fully qualified resource name of applied
         [controls](https://cloud.google.com/retail/docs/serving-control-rules).
         
        repeated string applied_controls = 12;
        Specified by:
        getAppliedControlsCount in interface SearchResponseOrBuilder
        Returns:
        The count of appliedControls.
      • getAppliedControls

        public String getAppliedControls​(int index)
         The fully qualified resource name of applied
         [controls](https://cloud.google.com/retail/docs/serving-control-rules).
         
        repeated string applied_controls = 12;
        Specified by:
        getAppliedControls in interface SearchResponseOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The appliedControls at the given index.
      • getAppliedControlsBytes

        public com.google.protobuf.ByteString getAppliedControlsBytes​(int index)
         The fully qualified resource name of applied
         [controls](https://cloud.google.com/retail/docs/serving-control-rules).
         
        repeated string applied_controls = 12;
        Specified by:
        getAppliedControlsBytes in interface SearchResponseOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the appliedControls at the given index.
      • getInvalidConditionBoostSpecsCount

        public int getInvalidConditionBoostSpecsCount()
         The invalid
         [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
         that are not applied during serving.
         
        repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14;
        Specified by:
        getInvalidConditionBoostSpecsCount in interface SearchResponseOrBuilder
      • getInvalidConditionBoostSpecs

        public SearchRequest.BoostSpec.ConditionBoostSpec getInvalidConditionBoostSpecs​(int index)
         The invalid
         [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
         that are not applied during serving.
         
        repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14;
        Specified by:
        getInvalidConditionBoostSpecs in interface SearchResponseOrBuilder
      • getExperimentInfoList

        public List<ExperimentInfo> getExperimentInfoList()
         Metadata related to A/B testing
         [Experiment][google.cloud.retail.v2alpha.Experiment] associated with this
         response. Only exists when an experiment is triggered.
         
        repeated .google.cloud.retail.v2alpha.ExperimentInfo experiment_info = 17;
        Specified by:
        getExperimentInfoList in interface SearchResponseOrBuilder
      • getExperimentInfoOrBuilderList

        public List<? extends ExperimentInfoOrBuilder> getExperimentInfoOrBuilderList()
         Metadata related to A/B testing
         [Experiment][google.cloud.retail.v2alpha.Experiment] associated with this
         response. Only exists when an experiment is triggered.
         
        repeated .google.cloud.retail.v2alpha.ExperimentInfo experiment_info = 17;
        Specified by:
        getExperimentInfoOrBuilderList in interface SearchResponseOrBuilder
      • getExperimentInfoCount

        public int getExperimentInfoCount()
         Metadata related to A/B testing
         [Experiment][google.cloud.retail.v2alpha.Experiment] associated with this
         response. Only exists when an experiment is triggered.
         
        repeated .google.cloud.retail.v2alpha.ExperimentInfo experiment_info = 17;
        Specified by:
        getExperimentInfoCount in interface SearchResponseOrBuilder
      • getExperimentInfo

        public ExperimentInfo getExperimentInfo​(int index)
         Metadata related to A/B testing
         [Experiment][google.cloud.retail.v2alpha.Experiment] associated with this
         response. Only exists when an experiment is triggered.
         
        repeated .google.cloud.retail.v2alpha.ExperimentInfo experiment_info = 17;
        Specified by:
        getExperimentInfo in interface SearchResponseOrBuilder
      • getExperimentInfoOrBuilder

        public ExperimentInfoOrBuilder getExperimentInfoOrBuilder​(int index)
         Metadata related to A/B testing
         [Experiment][google.cloud.retail.v2alpha.Experiment] associated with this
         response. Only exists when an experiment is triggered.
         
        repeated .google.cloud.retail.v2alpha.ExperimentInfo experiment_info = 17;
        Specified by:
        getExperimentInfoOrBuilder in interface SearchResponseOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static SearchResponse parseFrom​(ByteBuffer data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(ByteBuffer data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(com.google.protobuf.ByteString data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(com.google.protobuf.ByteString data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(byte[] data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(byte[] data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SearchResponse parseFrom​(com.google.protobuf.CodedInputStream input,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws IOException
        Throws:
        IOException
      • newBuilderForType

        public SearchResponse.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public SearchResponse.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected SearchResponse.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static SearchResponse getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<SearchResponse> parser()
      • getParserForType

        public com.google.protobuf.Parser<SearchResponse> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public SearchResponse getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder