Class: Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec

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

Overview

Search specification.

Defined Under Namespace

Classes: SearchParams, SearchResultList

Instance Attribute Summary collapse

Instance Attribute Details

#search_params::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams

Returns Search parameters.

Note: The following fields are mutually exclusive: search_params, search_result_list. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 502

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

  # Search parameters.
  # @!attribute [rw] max_return_results
  #   @return [::Integer]
  #     Number of search results to return.
  #     The default value is 10.
  # @!attribute [rw] filter
  #   @return [::String]
  #     The filter syntax consists of an expression language for constructing
  #     a predicate from one or more fields of the documents being filtered.
  #     Filter expression is case-sensitive. This will be used to filter
  #     search results which may affect the Answer response.
  #
  #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
  #
  #     Filtering in Vertex AI Search is done by mapping the LHS filter key
  #     to a key property defined in the Vertex AI Search backend -- this
  #     mapping is defined by the customer in their schema. For example a
  #     media customers might have a field 'name' in their schema. In this
  #     case the filter would look like this: filter --> name:'ANY("king
  #     kong")'
  #
  #     For more information about filtering including syntax and filter
  #     operators, see
  #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
  #     Boost specification to boost certain documents in search results which
  #     may affect the answer query response. For more information on boosting,
  #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
  # @!attribute [rw] order_by
  #   @return [::String]
  #     The order in which documents are returned. Documents can be ordered
  #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
  #     object. Leave it unset if ordered by relevance. `order_by` expression
  #     is case-sensitive. For more information on ordering, see
  #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
  #
  #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  #     See [parse and chunk
  #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
  # @!attribute [rw] data_store_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
  #     Specs defining dataStores to filter on in a search call and
  #     configurations for those dataStores. This is only considered for
  #     engines with multiple dataStores use case. For single dataStore within
  #     an engine, they should use the specs at the top level.
  class SearchParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Search result list.
  # @!attribute [rw] search_results
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
  #     Search results.
  class SearchResultList
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search result.
    # @!attribute [rw] unstructured_document_info
    #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
    #     Unstructured document information.
    #
    #     Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] chunk_info
    #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
    #     Chunk information.
    #
    #     Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class SearchResult
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Unstructured document information.
      # @!attribute [rw] document
      #   @return [::String]
      #     Document resource name.
      # @!attribute [rw] uri
      #   @return [::String]
      #     URI for the document.
      # @!attribute [rw] title
      #   @return [::String]
      #     Title.
      # @!attribute [rw] document_contexts
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
      #     List of document contexts. The content will be used for Answer
      #     Generation. This is supposed to be the main content of the document
      #     that can be long and comprehensive.
      # @!attribute [rw] extractive_segments
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
      #     List of extractive segments.
      # @!attribute [rw] extractive_answers
      #   @deprecated This field is deprecated and may be removed in the next major version update.
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
      #     Deprecated: This field is deprecated and will have no effect on
      #     the Answer generation.
      #     Please use document_contexts and extractive_segments fields.
      #     List of extractive answers.
      class UnstructuredDocumentInfo
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Document context.
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Document content to be used for answer generation.
        class DocumentContext
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Extractive segment.
        # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
        # Answer generation will only use it if document_contexts is empty.
        # This is supposed to be shorter snippets.
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Extractive segment content.
        class ExtractiveSegment
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Extractive answer.
        # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Extractive answer content.
        class ExtractiveAnswer
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end
      end

      # Chunk information.
      # @!attribute [rw] chunk
      #   @return [::String]
      #     Chunk resource name.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] document_metadata
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
      #     Metadata of the document from the current chunk.
      class ChunkInfo
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Document metadata contains the information of the document of the
        # current chunk.
        # @!attribute [rw] uri
        #   @return [::String]
        #     Uri of the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title of the document.
        class 
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end
      end
    end
  end
end

#search_result_list::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList

Returns Search result list.

Note: The following fields are mutually exclusive: search_result_list, search_params. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 502

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

  # Search parameters.
  # @!attribute [rw] max_return_results
  #   @return [::Integer]
  #     Number of search results to return.
  #     The default value is 10.
  # @!attribute [rw] filter
  #   @return [::String]
  #     The filter syntax consists of an expression language for constructing
  #     a predicate from one or more fields of the documents being filtered.
  #     Filter expression is case-sensitive. This will be used to filter
  #     search results which may affect the Answer response.
  #
  #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
  #
  #     Filtering in Vertex AI Search is done by mapping the LHS filter key
  #     to a key property defined in the Vertex AI Search backend -- this
  #     mapping is defined by the customer in their schema. For example a
  #     media customers might have a field 'name' in their schema. In this
  #     case the filter would look like this: filter --> name:'ANY("king
  #     kong")'
  #
  #     For more information about filtering including syntax and filter
  #     operators, see
  #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
  #     Boost specification to boost certain documents in search results which
  #     may affect the answer query response. For more information on boosting,
  #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
  # @!attribute [rw] order_by
  #   @return [::String]
  #     The order in which documents are returned. Documents can be ordered
  #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
  #     object. Leave it unset if ordered by relevance. `order_by` expression
  #     is case-sensitive. For more information on ordering, see
  #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
  #
  #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  #     See [parse and chunk
  #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
  # @!attribute [rw] data_store_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
  #     Specs defining dataStores to filter on in a search call and
  #     configurations for those dataStores. This is only considered for
  #     engines with multiple dataStores use case. For single dataStore within
  #     an engine, they should use the specs at the top level.
  class SearchParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Search result list.
  # @!attribute [rw] search_results
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
  #     Search results.
  class SearchResultList
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search result.
    # @!attribute [rw] unstructured_document_info
    #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
    #     Unstructured document information.
    #
    #     Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] chunk_info
    #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
    #     Chunk information.
    #
    #     Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class SearchResult
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Unstructured document information.
      # @!attribute [rw] document
      #   @return [::String]
      #     Document resource name.
      # @!attribute [rw] uri
      #   @return [::String]
      #     URI for the document.
      # @!attribute [rw] title
      #   @return [::String]
      #     Title.
      # @!attribute [rw] document_contexts
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
      #     List of document contexts. The content will be used for Answer
      #     Generation. This is supposed to be the main content of the document
      #     that can be long and comprehensive.
      # @!attribute [rw] extractive_segments
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
      #     List of extractive segments.
      # @!attribute [rw] extractive_answers
      #   @deprecated This field is deprecated and may be removed in the next major version update.
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
      #     Deprecated: This field is deprecated and will have no effect on
      #     the Answer generation.
      #     Please use document_contexts and extractive_segments fields.
      #     List of extractive answers.
      class UnstructuredDocumentInfo
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Document context.
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Document content to be used for answer generation.
        class DocumentContext
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Extractive segment.
        # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
        # Answer generation will only use it if document_contexts is empty.
        # This is supposed to be shorter snippets.
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Extractive segment content.
        class ExtractiveSegment
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Extractive answer.
        # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
        # @!attribute [rw] page_identifier
        #   @return [::String]
        #     Page identifier.
        # @!attribute [rw] content
        #   @return [::String]
        #     Extractive answer content.
        class ExtractiveAnswer
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end
      end

      # Chunk information.
      # @!attribute [rw] chunk
      #   @return [::String]
      #     Chunk resource name.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] document_metadata
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
      #     Metadata of the document from the current chunk.
      class ChunkInfo
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Document metadata contains the information of the document of the
        # current chunk.
        # @!attribute [rw] uri
        #   @return [::String]
        #     Uri of the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title of the document.
        class 
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end
      end
    end
  end
end