Class: Google::Cloud::DiscoveryEngine::V1::SearchResponse

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

Overview

Response message for SearchService.Search method.

Defined Under Namespace

Classes: Facet, QueryExpansionInfo, SearchResult, Summary

Instance Attribute Summary collapse

Instance Attribute Details

#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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end

#facets::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet>

Returns Results of facets requested by user.

Returns:



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end

#query_expansion_info::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo

Returns Query expansion information for the returned results.

Returns:



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end

#results::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>

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

Returns:



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end

#summary::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary

Returns A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

Returns:



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end

#total_size::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.

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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 667

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as retrievable are populated.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. E.g., "colors" or "price". It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::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 "colors".
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Summary of the top N search result specified by the summary spec.
  # @!attribute [rw] summary_text
  #   @return [::String]
  #     The summary content.
  # @!attribute [rw] summary_skipped_reasons
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
  #     Additional summary-skipped reasons. This provides the reason for ignored
  #     cases. If nothing is skipped, this field is not set.
  # @!attribute [rw] safety_attributes
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
  #     A collection of Safety Attribute categories and their associated
  #     confidence scores.
  # @!attribute [rw] summary_with_metadata
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata]
  #     Summary with metadata information.
  class Summary
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Safety Attribute categories and their associated confidence scores.
    # @!attribute [rw] categories
    #   @return [::Array<::String>]
    #     The display names of Safety Attribute categories associated with the
    #     generated content. Order matches the Scores.
    # @!attribute [rw] scores
    #   @return [::Array<::Float>]
    #     The confidence scores of the each category, higher
    #     value means higher confidence. Order matches the Categories.
    class SafetyAttributes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation metadata.
    # @!attribute [rw] citations
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>]
    #     Citations for segments.
    class CitationMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation info for a segment.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Index indicates the start of the segment, measured in bytes/unicode.
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the attributed segment, exclusive.
    # @!attribute [rw] sources
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>]
    #     Citation sources for the attributed segment.
    class Citation
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Citation source.
    # @!attribute [rw] reference_index
    #   @return [::Integer]
    #     Document reference index from SummaryWithMetadata.references.
    #     It is 0-indexed and the value will be zero if the reference_index is
    #     not set explicitly.
    class CitationSource
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Summary with metadata information.
    # @!attribute [rw] summary
    #   @return [::String]
    #     Summary text with no citation information.
    # @!attribute [rw] citation_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata]
    #     Citation metadata for given summary.
    # @!attribute [rw] references
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>]
    #     Document References.
    class SummaryWithMetadata
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # An Enum for summary-skipped reasons.
    module SummarySkippedReason
      # Default value. The summary skipped reason is not specified.
      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0

      # The adversarial query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
      # is set to `true`.
      ADVERSARIAL_QUERY_IGNORED = 1

      # The non-summary seeking query ignored case.
      #
      # Only populated when
      # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2

      # The out-of-domain query ignored case.
      #
      # Google skips the summary if there are no high-relevance search results.
      # For example, the data store contains facts about company A but the
      # user query is asking questions about company B.
      OUT_OF_DOMAIN_QUERY_IGNORED = 3

      # The potential policy violation case.
      #
      # Google skips the summary if there is a potential policy violation
      # detected. This includes content that may be violent or toxic.
      POTENTIAL_POLICY_VIOLATION = 4

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5
    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::DiscoveryEngine::V1::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
end