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.discoveryengine.v1.SearchService.Search]
     method.
     
    Protobuf type google.cloud.discoveryengine.v1.SearchResponse
    See Also:
    Serialized Form
    • Field Detail

      • TOTAL_SIZE_FIELD_NUMBER

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

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

        public static final int REDIRECT_URI_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
      • CORRECTED_QUERY_FIELD_NUMBER

        public static final int CORRECTED_QUERY_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
    • 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 documents. The order represents the ranking.
         
        repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1;
        Specified by:
        getResultsCount in interface SearchResponseOrBuilder
      • getFacetsCount

        public int getFacetsCount()
         Results of facets requested by user.
         
        repeated .google.cloud.discoveryengine.v1.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.discoveryengine.v1.SearchResponse.results]
         returned by pagination may be less than the
         [total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
         that matches.
         
        int32 total_size = 3;
        Specified by:
        getTotalSize in interface SearchResponseOrBuilder
        Returns:
        The totalSize.
      • getAttributionToken

        public String getAttributionToken()
         A unique search token. This should be included in the
         [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
         this search, which enables accurate attribution of search model
         performance.
         
        string attribution_token = 4;
        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.discoveryengine.v1.UserEvent] logs resulting from
         this search, which enables accurate attribution of search model
         performance.
         
        string attribution_token = 4;
        Specified by:
        getAttributionTokenBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for attributionToken.
      • 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.discoveryengine.v1.SearchResponse.redirect_uri]
         and
         [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
         are set in the response.
         
        string redirect_uri = 12;
        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.discoveryengine.v1.SearchResponse.redirect_uri]
         and
         [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
         are set in the response.
         
        string redirect_uri = 12;
        Specified by:
        getRedirectUriBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for redirectUri.
      • getNextPageToken

        public String getNextPageToken()
         A token that can be sent as
         [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token]
         to retrieve the next page. If this field is omitted, there are no
         subsequent pages.
         
        string next_page_token = 5;
        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.discoveryengine.v1.SearchRequest.page_token]
         to retrieve the next page. If this field is omitted, there are no
         subsequent pages.
         
        string next_page_token = 5;
        Specified by:
        getNextPageTokenBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for nextPageToken.
      • 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 = 7;
        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 = 7;
        Specified by:
        getCorrectedQueryBytes in interface SearchResponseOrBuilder
        Returns:
        The bytes for correctedQuery.
      • hasSummary

        public boolean hasSummary()
         A summary as part of the search results.
         This field is only returned if
         [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
         is set.
         
        .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9;
        Specified by:
        hasSummary in interface SearchResponseOrBuilder
        Returns:
        Whether the summary field is set.
      • getSummary

        public SearchResponse.Summary getSummary()
         A summary as part of the search results.
         This field is only returned if
         [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
         is set.
         
        .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9;
        Specified by:
        getSummary in interface SearchResponseOrBuilder
        Returns:
        The summary.
      • getSummaryOrBuilder

        public SearchResponse.SummaryOrBuilder getSummaryOrBuilder()
         A summary as part of the search results.
         This field is only returned if
         [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
         is set.
         
        .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9;
        Specified by:
        getSummaryOrBuilder in interface SearchResponseOrBuilder
      • hasQueryExpansionInfo

        public boolean hasQueryExpansionInfo()
         Query expansion information for the returned results.
         
        .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14;
        Specified by:
        hasQueryExpansionInfo in interface SearchResponseOrBuilder
        Returns:
        Whether the queryExpansionInfo field is set.
      • 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