Class: Google::Cloud::DiscoveryEngine::V1beta::SearchRequest

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

Overview

Request message for SearchService.Search method.

Defined Under Namespace

Modules: RankingExpressionBackend, RelevanceThreshold Classes: BoostSpec, ContentSearchSpec, CrowdingSpec, CustomRankingParams, DataStoreSpec, DisplaySpec, EmbeddingSpec, FacetSpec, ImageQuery, NaturalLanguageQueryUnderstandingSpec, ParamsEntry, PersonalizationSpec, QueryExpansionSpec, RelevanceFilterSpec, RelevanceScoreSpec, SearchAddonSpec, SearchAsYouTypeSpec, SessionSpec, SpellCorrectionSpec, UserLabelsEntry

Instance Attribute Summary collapse

Instance Attribute Details

#boost_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec

Returns Boost specification to boost certain documents. For more information on boosting, see Boosting.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#branch::String

Returns The branch resource name, such as projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0.

Use default_branch as the branch ID or leave this field empty, to search documents under the default branch.

Returns:

  • (::String)

    The branch resource name, such as projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0.

    Use default_branch as the branch ID or leave this field empty, to search documents under the default branch.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#canonical_filter::String

Returns The default filter that is applied when a user performs a search without checking any filters on the search page.

The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality.

For more information about filter syntax, see SearchRequest.filter.

Returns:

  • (::String)

    The default filter that is applied when a user performs a search without checking any filters on the search page.

    The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality.

    For more information about filter syntax, see SearchRequest.filter.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#content_search_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec

Returns A specification for configuring the behavior of content search.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#crowding_specs::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec>

Returns Optional. Crowding specifications for improving result diversity. If multiple CrowdingSpecs are specified, crowding will be evaluated on each unique combination of the field values, and max_count will be the maximum value of max_count across all CrowdingSpecs. For example, if the first CrowdingSpec has field = "color" and max_count = 3, and the second CrowdingSpec has field = "size" and max_count = 2, then after 3 documents that share the same color AND size have been returned, subsequent ones should be removed or demoted.

Returns:

  • (::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec>)

    Optional. Crowding specifications for improving result diversity. If multiple CrowdingSpecs are specified, crowding will be evaluated on each unique combination of the field values, and max_count will be the maximum value of max_count across all CrowdingSpecs. For example, if the first CrowdingSpec has field = "color" and max_count = 3, and the second CrowdingSpec has field = "size" and max_count = 2, then after 3 documents that share the same color AND size have been returned, subsequent ones should be removed or demoted.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#custom_ranking_params::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CustomRankingParams

Returns Optional. Optional configuration for the Custom Ranking feature.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#data_store_specs::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DataStoreSpec>

Returns Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. For engines with a single data store, the specs directly under SearchRequest should be used.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#display_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec

Returns Optional. Config for display feature, like match highlighting on search results.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#embedding_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec

Returns Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embedding that is provided in SearchRequest.EmbeddingSpec.EmbeddingVector.field_path.

If SearchRequest.EmbeddingSpec.EmbeddingVector.field_path is not provided, it will use ServingConfig.EmbeddingConfig.field_path.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#entity::String

Returns Optional. The entity for customers that may run multiple different entities, domains, sites or regions, for example, "Google US", "Google Ads", "Waymo", "google.com", "youtube.com", etc. If this is set, it should be exactly matched with UserEvent.entity to get search results boosted by entity.

Returns:

  • (::String)

    Optional. The entity for customers that may run multiple different entities, domains, sites or regions, for example, "Google US", "Google Ads", "Waymo", "google.com", "youtube.com", etc. If this is set, it should be exactly matched with UserEvent.entity to get search results boosted by entity.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#facet_specs::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec>

Returns Facet specifications for faceted search. If empty, no facets are returned.

A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#filter::String

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

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

Returns:

  • (::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.

    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 customer 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



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#image_query::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ImageQuery

Returns Raw image query.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#language_code::String

Returns The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Standard fields. This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate.

Returns:

  • (::String)

    The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Standard fields. This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#natural_language_query_understanding_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec

Returns Optional. Config for natural language query understanding capabilities, such as extracting structured field filters from the query. Refer to this documentation for more information. If naturalLanguageQueryUnderstandingSpec is not specified, no additional natural language query understanding will be done.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#num_results_per_data_store::Integer

Returns Optional. The maximum number of results to retrieve from each data store. If not specified, it will use the SearchRequest.DataStoreSpec.num_results if provided, otherwise there is no limit.

Returns:

  • (::Integer)

    Optional. The maximum number of results to retrieve from each data store. If not specified, it will use the SearchRequest.DataStoreSpec.num_results if provided, otherwise there is no limit.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#offset::Integer

Returns A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset.

If this field is negative, an INVALID_ARGUMENT is returned.

A large offset may be capped to a reasonable threshold.

Returns:

  • (::Integer)

    A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset.

    If this field is negative, an INVALID_ARGUMENT is returned.

    A large offset may be capped to a reasonable threshold.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#one_box_page_size::Integer

Returns The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.

Returns:

  • (::Integer)

    The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#order_by::String

Returns The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. order_by expression is case-sensitive.

For more information on ordering the website search results, see Order web search results. For more information on ordering the healthcare search results, see Order healthcare search results. If this field is unrecognizable, an INVALID_ARGUMENT is returned.

Returns:

  • (::String)

    The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. order_by expression is case-sensitive.

    For more information on ordering the website search results, see Order web search results. For more information on ordering the healthcare search results, see Order healthcare search results. If this field is unrecognizable, an INVALID_ARGUMENT is returned.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#page_categories::Array<::String>

Returns Optional. The categories associated with a category page. Must be set for category navigation queries to achieve good search quality. The format should be the same as PageInfo.page_category. This field is the equivalent of the query for browse (navigation) queries. It's used by the browse model when the query is empty.

If the field is empty, it will not be used by the browse model. If the field contains more than one element, only the first element will be used.

To represent full path of a category, use '>' character to separate different hierarchies. If '>' is part of the category name, replace it with other character(s). For example, Graphics Cards > RTX>4090 > Founders Edition where "RTX > 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090

Founders Edition`.

Returns:

  • (::Array<::String>)

    Optional. The categories associated with a category page. Must be set for category navigation queries to achieve good search quality. The format should be the same as PageInfo.page_category. This field is the equivalent of the query for browse (navigation) queries. It's used by the browse model when the query is empty.

    If the field is empty, it will not be used by the browse model. If the field contains more than one element, only the first element will be used.

    To represent full path of a category, use '>' character to separate different hierarchies. If '>' is part of the category name, replace it with other character(s). For example, Graphics Cards > RTX>4090 > Founders Edition where "RTX > 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090

    Founders Edition`



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#page_size::Integer

Returns Maximum number of Documents to return. The maximum allowed value depends on the data type. Values above the maximum value are coerced to the maximum value.

  • Websites with basic indexing: Default 10, Maximum 25.
  • Websites with advanced indexing: Default 25, Maximum 50.
  • Other: Default 50, Maximum 100.

If this field is negative, an INVALID_ARGUMENT is returned.

Returns:

  • (::Integer)

    Maximum number of Documents to return. The maximum allowed value depends on the data type. Values above the maximum value are coerced to the maximum value.

    • Websites with basic indexing: Default 10, Maximum 25.
    • Websites with advanced indexing: Default 25, Maximum 50.
    • Other: Default 50, Maximum 100.

    If this field is negative, an INVALID_ARGUMENT is returned.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#page_token::String

Returns A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.

Returns:

  • (::String)

    A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#params::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}

Returns Additional search parameters.

For public website search only, supported values are:

  • user_country_code: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. For example, user_country_code: "au"

For available codes see Country Codes

  • search_type: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching. For example, search_type: 1.

Returns:

  • (::Google::Protobuf::Map{::String => ::Google::Protobuf::Value})

    Additional search parameters.

    For public website search only, supported values are:

    • user_country_code: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. For example, user_country_code: "au"

    For available codes see Country Codes

    • search_type: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching. For example, search_type: 1


481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#personalization_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec

Returns The specification for personalization.

Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#query::String

Returns Raw search query.

Returns:

  • (::String)

    Raw search query.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#query_expansion_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec

Returns The query expansion specification that specifies the conditions under which query expansion occurs.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#ranking_expression::String

Returns Optional. The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The syntax and supported features depend on the ranking_expression_backend value. If ranking_expression_backend is not provided, it defaults to RANK_BY_EMBEDDING.

If ranking_expression_backend is not provided or set to RANK_BY_EMBEDDING, it should be a single function or multiple functions that are joined by "+".

  • ranking_expression = function, { " + ", function };

Supported functions:

  • double * relevance_score
  • double * dotProduct(embedding_field_path)

Function variables:

  • relevance_score: pre-defined keywords, used for measure relevance between query and document.
  • embedding_field_path: the document embedding field used with query embedding vector.
  • dotProduct: embedding function between embedding_field_path and query embedding vector.

Example ranking expression:

If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).

If ranking_expression_backend is set to RANK_BY_FORMULA, the following expression types (and combinations of those chained using + or

  • operators) are supported:

    • double
    • signal
    • log(signal)
    • exp(signal)
    • rr(signal, double > 0) -- reciprocal rank transformation with second argument being a denominator constant.
    • is_nan(signal) -- returns 0 if signal is NaN, 1 otherwise.
    • fill_nan(signal1, signal2 | double) -- if signal1 is NaN, returns signal2 | double, else returns signal1.

Here are a few examples of ranking formulas that use the supported ranking expression types:

  • 0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score) -- mostly rank by the logarithm of keyword_similarity_score with slight semantic_smilarity_score adjustment.
  • 0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * is_nan(keyword_similarity_score) -- rank by the exponent of semantic_similarity_score filling the value with 0 if it's NaN, also add constant 0.3 adjustment to the final score if semantic_similarity_score is NaN.
  • 0.2 * rr(semantic_similarity_score, 16) + 0.8 * rr(keyword_similarity_score, 16) -- mostly rank by the reciprocal rank of keyword_similarity_score with slight adjustment of reciprocal rank of semantic_smilarity_score.

The following signals are supported:

  • semantic_similarity_score: semantic similarity adjustment that is calculated using the embeddings generated by a proprietary Google model. This score determines how semantically similar a search query is to a document.
  • keyword_similarity_score: keyword match adjustment uses the Best Match 25 (BM25) ranking function. This score is calculated using a probabilistic model to estimate the probability that a document is relevant to a given query.
  • relevance_score: semantic relevance adjustment that uses a proprietary Google model to determine the meaning and intent behind a user's query in context with the content in the documents.
  • pctr_rank: predicted conversion rate adjustment as a rank use predicted Click-through rate (pCTR) to gauge the relevance and attractiveness of a search result from a user's perspective. A higher pCTR suggests that the result is more likely to satisfy the user's query and intent, making it a valuable signal for ranking.
  • freshness_rank: freshness adjustment as a rank
  • document_age: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes).
  • topicality_rank: topicality adjustment as a rank. Uses proprietary Google model to determine the keyword-based overlap between the query and the document.
  • base_rank: the default rank of the result
  • media_actor_match: whether the media actor matches the query
  • media_director_match: whether the media director matches the query
  • media_genre_match: whether the media genre matches the query
  • media_language_match: whether the media language matches the query
  • media_title_match: whether the media title matches the query
  • media_prefix_similarity_rank: prefix similarity rank for media results
  • media_semantic_similarity_rank: semantic similarity rank for media results.

Returns:

  • (::String)

    Optional. The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The syntax and supported features depend on the ranking_expression_backend value. If ranking_expression_backend is not provided, it defaults to RANK_BY_EMBEDDING.

    If ranking_expression_backend is not provided or set to RANK_BY_EMBEDDING, it should be a single function or multiple functions that are joined by "+".

    • ranking_expression = function, { " + ", function };

    Supported functions:

    • double * relevance_score
    • double * dotProduct(embedding_field_path)

    Function variables:

    • relevance_score: pre-defined keywords, used for measure relevance between query and document.
    • embedding_field_path: the document embedding field used with query embedding vector.
    • dotProduct: embedding function between embedding_field_path and query embedding vector.

    Example ranking expression:

    If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).

    If ranking_expression_backend is set to RANK_BY_FORMULA, the following expression types (and combinations of those chained using + or

    • operators) are supported:

      • double
      • signal
      • log(signal)
      • exp(signal)
      • rr(signal, double > 0) -- reciprocal rank transformation with second argument being a denominator constant.
      • is_nan(signal) -- returns 0 if signal is NaN, 1 otherwise.
      • fill_nan(signal1, signal2 | double) -- if signal1 is NaN, returns signal2 | double, else returns signal1.

    Here are a few examples of ranking formulas that use the supported ranking expression types:

    • 0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score) -- mostly rank by the logarithm of keyword_similarity_score with slight semantic_smilarity_score adjustment.
    • 0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * is_nan(keyword_similarity_score) -- rank by the exponent of semantic_similarity_score filling the value with 0 if it's NaN, also add constant 0.3 adjustment to the final score if semantic_similarity_score is NaN.
    • 0.2 * rr(semantic_similarity_score, 16) + 0.8 * rr(keyword_similarity_score, 16) -- mostly rank by the reciprocal rank of keyword_similarity_score with slight adjustment of reciprocal rank of semantic_smilarity_score.

    The following signals are supported:

    • semantic_similarity_score: semantic similarity adjustment that is calculated using the embeddings generated by a proprietary Google model. This score determines how semantically similar a search query is to a document.
    • keyword_similarity_score: keyword match adjustment uses the Best Match 25 (BM25) ranking function. This score is calculated using a probabilistic model to estimate the probability that a document is relevant to a given query.
    • relevance_score: semantic relevance adjustment that uses a proprietary Google model to determine the meaning and intent behind a user's query in context with the content in the documents.
    • pctr_rank: predicted conversion rate adjustment as a rank use predicted Click-through rate (pCTR) to gauge the relevance and attractiveness of a search result from a user's perspective. A higher pCTR suggests that the result is more likely to satisfy the user's query and intent, making it a valuable signal for ranking.
    • freshness_rank: freshness adjustment as a rank
    • document_age: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes).
    • topicality_rank: topicality adjustment as a rank. Uses proprietary Google model to determine the keyword-based overlap between the query and the document.
    • base_rank: the default rank of the result
    • media_actor_match: whether the media actor matches the query
    • media_director_match: whether the media director matches the query
    • media_genre_match: whether the media genre matches the query
    • media_language_match: whether the media language matches the query
    • media_title_match: whether the media title matches the query
    • media_prefix_similarity_rank: prefix similarity rank for media results
    • media_semantic_similarity_rank: semantic similarity rank for media results


481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#ranking_expression_backend::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RankingExpressionBackend

Returns Optional. The backend to use for the ranking expression evaluation.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#region_code::String

Returns The Unicode country/region code (CLDR) of a location, such as "US" and "419". For more information, see Standard fields. If set, then results will be boosted based on the region_code provided.

Returns:

  • (::String)

    The Unicode country/region code (CLDR) of a location, such as "US" and "419". For more information, see Standard fields. If set, then results will be boosted based on the region_code provided.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#relevance_filter_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec

Returns Optional. The granular relevance filtering specification.

If not specified, the global relevance_threshold will be used for all sub-searches. If specified, this overrides the global relevance_threshold to use thresholds on a per sub-search basis.

This feature is currently supported only for custom and site search.

Returns:

  • (::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec)

    Optional. The granular relevance filtering specification.

    If not specified, the global relevance_threshold will be used for all sub-searches. If specified, this overrides the global relevance_threshold to use thresholds on a per sub-search basis.

    This feature is currently supported only for custom and site search.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#relevance_score_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceScoreSpec

Returns Optional. The specification for returning the relevance score.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#relevance_threshold::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold

Returns The global relevance threshold of the search results.

Defaults to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information.

If more granular relevance filtering is required, use the relevance_filter_spec instead.

This feature is not supported for healthcare search.

Returns:

  • (::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold)

    The global relevance threshold of the search results.

    Defaults to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information.

    If more granular relevance filtering is required, use the relevance_filter_spec instead.

    This feature is not supported for healthcare search.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#safe_search::Boolean

Returns Whether to turn on safe search. This is only supported for website search.

Returns:

  • (::Boolean)

    Whether to turn on safe search. This is only supported for website search.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#search_addon_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAddonSpec

Returns Optional. SearchAddonSpec is used to disable add-ons for search as per new repricing model. This field is only supported for search requests.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#search_as_you_type_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec

Returns Search as you type configuration. Only supported for the IndustryVertical.MEDIA vertical.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#serving_config::String

Returns Required. The resource name of the Search serving config, such as projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config, or projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config. This field is used to identify the serving configuration name, set of models used to make the search.

Returns:

  • (::String)

    Required. The resource name of the Search serving config, such as projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config, or projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config. This field is used to identify the serving configuration name, set of models used to make the search.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#session::String

Returns The session resource name. Optional.

Session allows users to do multi-turn /search API calls or coordination between /search API calls and /answer API calls.

Example #1 (multi-turn /search API calls): Call /search API with the session ID generated in the first call. Here, the previous search query gets considered in query standing. I.e., if the first query is "How did Alphabet do in 2022?" and the current query is "How about 2023?", the current query will be interpreted as "How did Alphabet do in 2023?".

Example #2 (coordination between /search API calls and /answer API calls): Call /answer API with the session ID generated in the first call. Here, the answer generation happens in the context of the search results from the first search call.

Returns:

  • (::String)

    The session resource name. Optional.

    Session allows users to do multi-turn /search API calls or coordination between /search API calls and /answer API calls.

    Example #1 (multi-turn /search API calls): Call /search API with the session ID generated in the first call. Here, the previous search query gets considered in query standing. I.e., if the first query is "How did Alphabet do in 2022?" and the current query is "How about 2023?", the current query will be interpreted as "How did Alphabet do in 2023?".

    Example #2 (coordination between /search API calls and /answer API calls): Call /answer API with the session ID generated in the first call. Here, the answer generation happens in the context of the search results from the first search call.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#session_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SessionSpec

Returns Session specification.

Can be used only when session is set.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#spell_correction_spec::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec

Returns The spell correction specification that specifies the mode under which spell correction takes effect.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#user_info::Google::Cloud::DiscoveryEngine::V1beta::UserInfo

Returns Information about the end user. Highly recommended for analytics and personalization. UserInfo.user_agent is used to deduce device_type for analytics.

Returns:



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#user_labels::Google::Protobuf::Map{::String => ::String}

Returns The user labels applied to a resource must meet the following requirements:

  • Each resource can have multiple labels, up to a maximum of 64.
  • Each label must be a key-value pair.
  • Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
  • Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
  • The key portion of a label must be unique. However, you can use the same key with multiple resources.
  • Keys must start with a lowercase letter or international character.

See Google Cloud Document for more details.

Returns:

  • (::Google::Protobuf::Map{::String => ::String})

    The user labels applied to a resource must meet the following requirements:

    • Each resource can have multiple labels, up to a maximum of 64.
    • Each label must be a key-value pair.
    • Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
    • Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
    • The key portion of a label must be unique. However, you can use the same key with multiple resources.
    • Keys must start with a lowercase letter or international character.

    See Google Cloud Document for more details.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end

#user_pseudo_id::String

Returns Optional. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.

This field should NOT have a fixed value such as unknown_visitor.

This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

Returns:

  • (::String)

    Optional. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.

    This field should NOT have a fixed value such as unknown_visitor.

    This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id

    The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb', line 481

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

  # Specifies the image query input.
  # @!attribute [rw] image_bytes
  #   @return [::String]
  #     Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
  #     BMP.
  class ImageQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A struct to define data stores to filter on in a search call and
  # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
  # error is returned.
  # @!attribute [rw] data_store
  #   @return [::String]
  #     Required. Full resource name of
  #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
  #     `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
  #     The path must include the project number, project id is not supported for
  #     this field.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Optional. Filter specification to filter documents in the data store
  #     specified by data_store field. For more information on filtering, see
  #     [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  # @!attribute [rw] boost_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
  #     Optional. Boost specification to boost certain documents.
  #     For more information on boosting, see
  #     [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
  # @!attribute [rw] custom_search_operators
  #   @return [::String]
  #     Optional. Custom search operators which if specified will be used to
  #     filter results from workspace data stores. For more information on custom
  #     search operators, see
  #     [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
  # @!attribute [rw] num_results
  #   @return [::Integer]
  #     Optional. The maximum number of results to retrieve from this data store.
  #     If not specified, it will use the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     if provided, otherwise there is no limit. If both this field and
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#num_results_per_data_store SearchRequest.num_results_per_data_store}
  #     are specified, this field will be used.
  class DataStoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A facet specification to perform faceted search.
  # @!attribute [rw] facet_key
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
  #     Required. The facet key specification.
  # @!attribute [rw] limit
  #   @return [::Integer]
  #     Maximum facet values that are returned for this facet. If
  #     unspecified, defaults to 20. The maximum allowed value is 300. Values
  #     above 300 are coerced to 300.
  #     For aggregation in healthcare search, when the [FacetKey.key] is
  #     "healthcare_aggregation_key", the limit will be overridden to
  #     10,000 internally, regardless of the value set here.
  #
  #     If this field is negative, an  `INVALID_ARGUMENT`  is returned.
  # @!attribute [rw] excluded_filter_keys
  #   @return [::Array<::String>]
  #     List of keys to exclude when faceting.
  #
  #     By default,
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     is not excluded from the filter unless it is listed in this field.
  #
  #     Listing a facet key in this field allows its values to appear as facet
  #     results, even when they are filtered out of search results. Using this
  #     field does not affect what search results are returned.
  #
  #     For example, suppose there are 100 documents with the color facet "Red"
  #     and 200 documents with the color facet "Blue". A query containing the
  #     filter "color:ANY("Red")" and having "color" as
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
  #     would by default return only "Red" documents in the search results, and
  #     also return "Red" with count 100 as the only color facet. Although there
  #     are also blue documents available, "Blue" would not be shown as an
  #     available facet value.
  #
  #     If "color" is listed in "excludedFilterKeys", then the query returns the
  #     facet values "Red" with count 100 and "Blue" with count 200, because the
  #     "color" key is now excluded from the filter. Because this field doesn't
  #     affect search results, the search results are still correctly filtered to
  #     return only "Red" documents.
  #
  #     A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
  #     error is returned.
  # @!attribute [rw] enable_dynamic_position
  #   @return [::Boolean]
  #     Enables dynamic position for this facet. If set to true, the position of
  #     this facet among all facets in the response is determined automatically.
  #     If dynamic facets are enabled, it is ordered together.
  #     If set to false, the position of this facet in the
  #     response is the same as in the request, and it is ranked before
  #     the facets with dynamic position enable and all dynamic facets.
  #
  #     For example, you may always want to have rating facet returned in
  #     the response, but it's not necessarily to always display the rating facet
  #     at the top. In that case, you can set enable_dynamic_position to true so
  #     that the position of rating facet in response is determined
  #     automatically.
  #
  #     Another example, assuming you have the following facets in the request:
  #
  #     * "rating", enable_dynamic_position = true
  #
  #     * "price", enable_dynamic_position = false
  #
  #     * "brands", enable_dynamic_position = false
  #
  #     And also you have a dynamic facets enabled, which generates a facet
  #     `gender`. Then the final order of the facets in the response can be
  #     ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
  #     "rating") depends on how API orders "gender" and "rating" facets.
  #     However, notice that "price" and "brands" are always
  #     ranked at first and second position because their enable_dynamic_position
  #     is false.
  class FacetSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specifies how a facet is computed.
    # @!attribute [rw] key
    #   @return [::String]
    #     Required. Supported textual and numerical facet keys in
    #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
    #     which the facet values are computed. Facet key is case-sensitive.
    # @!attribute [rw] intervals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
    #     Set only if values should be bucketed into intervals. Must be set
    #     for facets with numerical values. Must not be set for facet with text
    #     values. Maximum number of intervals is 30.
    # @!attribute [rw] restricted_values
    #   @return [::Array<::String>]
    #     Only get facet for the given restricted values. Only supported on
    #     textual fields. For example, suppose "category" has three values
    #     "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
    #     "restricted_values" to "Action > 2022", the "category" facet only
    #     contains "Action > 2022". Only supported on textual fields. Maximum
    #     is 10.
    # @!attribute [rw] prefixes
    #   @return [::Array<::String>]
    #     Only get facet values that start with the given string prefix. For
    #     example, suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
    #     "category" facet only contains "Action > 2022" and "Action > 2021".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] contains
    #   @return [::Array<::String>]
    #     Only get facet values that contain the given strings. For example,
    #     suppose "category" has three values "Action > 2022",
    #     "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
    #     "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
    #     Only supported on textual fields. Maximum is 10.
    # @!attribute [rw] case_insensitive
    #   @return [::Boolean]
    #     True to make facet keys case insensitive when getting faceting
    #     values with prefixes or contains; false otherwise.
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned.
    #
    #     Allowed values are:
    #
    #     * "count desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
    #     descending.
    #
    #     * "value desc", which means order by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
    #     descending.
    #       Only applies to textual facets.
    #
    #     If not set, textual values are sorted in [natural
    #     order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
    #     intervals are sorted in the order given by
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
    class FacetKey
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Boost specification to boost certain documents.
  # @!attribute [rw] condition_boost_specs
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
  #     Condition boost specifications. If a document matches multiple conditions
  #     in the specifications, boost scores from these specifications are all
  #     applied and combined in a non-linear way. Maximum number of
  #     specifications is 20.
  class BoostSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Boost applies to documents which match a condition.
    # @!attribute [rw] condition
    #   @return [::String]
    #     An expression which specifies a boost condition. The syntax and
    #     supported fields are the same as a filter expression. See
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
    #     for detail syntax and limitations.
    #
    #     Examples:
    #
    #     * To boost documents with document ID "doc_1" or "doc_2", and
    #     color "Red" or "Blue":
    #     `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
    # @!attribute [rw] boost
    #   @return [::Float]
    #     Strength of the condition boost, which should be in [-1, 1]. Negative
    #     boost means demotion. Default is 0.0.
    #
    #     Setting to 1.0 gives the document a big promotion. However, it does
    #     not necessarily mean that the boosted document will be the top result
    #     at all times, nor that other documents will be excluded. Results
    #     could still be shown even when none of them matches the condition.
    #     And results that are significantly more relevant to the search query
    #     can still trump your heavily favored but irrelevant documents.
    #
    #     Setting to -1.0 gives the document a big demotion. However, results
    #     that are deeply relevant might still be shown. The document will have
    #     an upstream battle to get a fairly high ranking, but it is not
    #     blocked out completely.
    #
    #     Setting to 0.0 means no boost applied. The boosting condition is
    #     ignored. Only one of the (condition, boost) combination or the
    #     boost_control_spec below are set. If both are set then the global boost
    #     is ignored and the more fine-grained boost_control_spec is applied.
    # @!attribute [rw] boost_control_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec]
    #     Complex specification for custom ranking based on customer defined
    #     attribute value.
    class ConditionBoostSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Specification for custom ranking based on customer specified attribute
      # value. It provides more controls for customized ranking than the simple
      # (condition, boost) combination above.
      # @!attribute [rw] field_name
      #   @return [::String]
      #     The name of the field whose value will be used to determine the
      #     boost amount.
      # @!attribute [rw] attribute_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType]
      #     The attribute type to be used to determine the boost amount. The
      #     attribute value can be derived from the field value of the specified
      #     field_name. In the case of numerical it is straightforward i.e.
      #     attribute_value = numerical_field_value. In the case of freshness
      #     however, attribute_value = (time.now() - datetime_field_value).
      # @!attribute [rw] interpolation_type
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType]
      #     The interpolation type to be applied to connect the control points
      #     listed below.
      # @!attribute [rw] control_points
      #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>]
      #     The control points used to define the curve. The monotonic function
      #     (defined through the interpolation_type above) passes through the
      #     control points listed here.
      class BoostControlSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # The control points used to define the curve. The curve defined
        # through these control points can only be monotonically increasing
        # or decreasing(constant values are acceptable).
        # @!attribute [rw] attribute_value
        #   @return [::String]
        #     Can be one of:
        #     1. The numerical field value.
        #     2. The duration spec for freshness:
        #     The value must be formatted as an XSD `dayTimeDuration` value (a
        #     restricted subset of an ISO 8601 duration value). The pattern for
        #     this is: `[nD][T[nH][nM][nS]]`.
        # @!attribute [rw] boost_amount
        #   @return [::Float]
        #     The value between -1 to 1 by which to boost the score if the
        #     attribute_value evaluates to the value specified above.
        class ControlPoint
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The attribute(or function) for which the custom ranking is to be
        # applied.
        module AttributeType
          # Unspecified AttributeType.
          ATTRIBUTE_TYPE_UNSPECIFIED = 0

          # The value of the numerical field will be used to dynamically update
          # the boost amount. In this case, the attribute_value (the x value)
          # of the control point will be the actual value of the numerical
          # field for which the boost_amount is specified.
          NUMERICAL = 1

          # For the freshness use case the attribute value will be the duration
          # between the current time and the date in the datetime field
          # specified. The value must be formatted as an XSD `dayTimeDuration`
          # value (a restricted subset of an ISO 8601 duration value). The
          # pattern for this is: `[nD][T[nH][nM][nS]]`.
          # For example, `5D`, `3DT12H30M`, `T24H`.
          FRESHNESS = 2
        end

        # The interpolation type to be applied. Default will be linear
        # (Piecewise Linear).
        module InterpolationType
          # Interpolation type is unspecified. In this case, it defaults to
          # Linear.
          INTERPOLATION_TYPE_UNSPECIFIED = 0

          # Piecewise linear interpolation will be applied.
          LINEAR = 1
        end
      end
    end
  end

  # Specification to determine under which conditions query expansion should
  # occur.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
  #     The condition under which query expansion should occur. Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
  # @!attribute [rw] pin_unexpanded_results
  #   @return [::Boolean]
  #     Whether to pin unexpanded results. If this field is set to true,
  #     unexpanded products are always at the top of the search results, followed
  #     by the expanded results.
  class QueryExpansionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition query expansion should occur.
    module Condition
      # Unspecified query expansion condition. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disabled query expansion. Only the exact search query is used, even if
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
      # is zero.
      DISABLED = 1

      # Automatic query expansion built by the Search API.
      AUTO = 2
    end
  end

  # The specification for query spell correction.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
  #     The mode under which spell correction
  #     replaces the original search query. Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
  class SpellCorrectionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which mode spell correction should occur.
    module Mode
      # Unspecified spell correction mode. In this case, server behavior
      # defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Search API tries to find a spelling suggestion. If a suggestion is
      # found, it is put in the
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
      # The spelling suggestion won't be used as the search query.
      SUGGESTION_ONLY = 1

      # Automatic spell correction built by the Search API. Search will
      # be based on the corrected query if found.
      AUTO = 2
    end
  end

  # A specification for configuring the behavior of content search.
  # @!attribute [rw] snippet_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
  #     If `snippetSpec` is not specified, snippets are not included in the
  #     search response.
  # @!attribute [rw] summary_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
  #     If `summarySpec` is not specified, summaries are not included in the
  #     search response.
  # @!attribute [rw] extractive_content_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ExtractiveContentSpec]
  #     If there is no extractive_content_spec provided, there will be no
  #     extractive answer in the search response.
  # @!attribute [rw] search_result_mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode]
  #     Specifies the search result mode. If unspecified, the
  #     search result mode defaults to `DOCUMENTS`.
  # @!attribute [rw] chunk_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::ChunkSpec]
  #     Specifies the chunk spec to be returned from the search response.
  #     Only available if the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
  class ContentSearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A specification for configuring snippets in a search response.
    # @!attribute [rw] max_snippet_count
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Integer]
    #     [DEPRECATED] This field is deprecated. To control snippet return, use
    #     `return_snippet` field. For backwards compatibility, we will return
    #     snippet if max_snippet_count > 0.
    # @!attribute [rw] reference_only
    #   @deprecated This field is deprecated and may be removed in the next major version update.
    #   @return [::Boolean]
    #     [DEPRECATED] This field is deprecated and will have no affect on the
    #     snippet.
    # @!attribute [rw] return_snippet
    #   @return [::Boolean]
    #     If `true`, then return snippet. If no snippet can be generated, we
    #     return "No snippet is available for this page." A `snippet_status` with
    #     `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    class SnippetSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A specification for configuring a summary returned in a search
    # response.
    # @!attribute [rw] summary_result_count
    #   @return [::Integer]
    #     The number of top results to generate the summary from. If the number
    #     of results returned is less than `summaryResultCount`, the summary is
    #     generated from all of the results.
    #
    #     At most 10 results for documents mode, or 50 for chunks mode, can be
    #     used to generate a summary. The chunks mode is used when
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    #     is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
    # @!attribute [rw] include_citations
    #   @return [::Boolean]
    #     Specifies whether to include citations in the summary. The default
    #     value is `false`.
    #
    #     When this field is set to `true`, summaries include in-line citation
    #     numbers.
    #
    #     Example summary including citations:
    #
    #     BigQuery is Google Cloud's fully managed and completely serverless
    #     enterprise data warehouse [1]. BigQuery supports all data types, works
    #     across clouds, and has built-in machine learning and business
    #     intelligence, all within a unified platform [2, 3].
    #
    #     The citation numbers refer to the returned search results and are
    #     1-indexed. For example, [1] means that the sentence is attributed to
    #     the first search result. [2, 3] means that the sentence is attributed
    #     to both the second and third search results.
    # @!attribute [rw] ignore_adversarial_query
    #   @return [::Boolean]
    #     Specifies whether to filter out adversarial queries. The default value
    #     is `false`.
    #
    #     Google employs search-query classification to detect adversarial
    #     queries. No summary is returned if the search query is classified as an
    #     adversarial query. For example, a user might ask a question regarding
    #     negative comments about the company or submit a query designed to
    #     generate unsafe, policy-violating output. If this field is set to
    #     `true`, we skip generating summaries for adversarial queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_non_summary_seeking_query
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that are not summary-seeking.
    #     The default value is `false`.
    #
    #     Google employs search-query classification to detect summary-seeking
    #     queries. No summary is returned if the search query is classified as a
    #     non-summary seeking query. For example, `why is the sky blue` and `Who
    #     is the best soccer player in the world?` are summary-seeking queries,
    #     but `SFO airport` and `world cup 2026` are not. They are most likely
    #     navigational queries. If this field is set to `true`, we skip
    #     generating summaries for non-summary seeking queries and return
    #     fallback messages instead.
    # @!attribute [rw] ignore_low_relevant_content
    #   @return [::Boolean]
    #     Specifies whether to filter out queries that have low relevance. The
    #     default value is `false`.
    #
    #     If this field is set to `false`, all search results are used regardless
    #     of relevance to generate answers. If set to `true`, only queries with
    #     high relevance search results will generate answers.
    # @!attribute [rw] ignore_jail_breaking_query
    #   @return [::Boolean]
    #     Optional. Specifies whether to filter out jail-breaking queries. The
    #     default value is `false`.
    #
    #     Google employs search-query classification to detect jail-breaking
    #     queries. No summary is returned if the search query is classified as a
    #     jail-breaking query. A user might add instructions to the query to
    #     change the tone, style, language, content of the answer, or ask the
    #     model to act as a different entity, e.g. "Reply in the tone of a
    #     competing company's CEO". If this field is set to `true`, we skip
    #     generating summaries for jail-breaking queries and return fallback
    #     messages instead.
    # @!attribute [rw] multimodal_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec]
    #     Optional. Multimodal specification.
    # @!attribute [rw] model_prompt_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec]
    #     If specified, the spec will be used to modify the prompt provided to
    #     the LLM.
    # @!attribute [rw] language_code
    #   @return [::String]
    #     Language code for Summary. Use language tags defined by
    #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
    #     Note: This is an experimental feature.
    # @!attribute [rw] model_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec]
    #     If specified, the spec will be used to modify the model specification
    #     provided to the LLM.
    # @!attribute [rw] use_semantic_chunks
    #   @return [::Boolean]
    #     If true, answer will be generated from most relevant chunks from top
    #     search results. This feature will improve summary quality.
    #     Note that with this feature enabled, not all top search results
    #     will be referenced and included in the reference list, so the citation
    #     source index only points to the search results listed in the reference
    #     list.
    class SummarySpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Multimodal specification: Will return an image from specified source.
      # If multiple sources are specified, the pick is a quality based
      # decision.
      # @!attribute [rw] image_source
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec::MultiModalSpec::ImageSource]
      #     Optional. Source of image returned in the answer.
      class MultiModalSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Specifies the image source.
        module ImageSource
          # Unspecified image source (multimodal feature is disabled by
          # default).
          IMAGE_SOURCE_UNSPECIFIED = 0

          # Behavior when service determines the pick from all available
          # sources.
          ALL_AVAILABLE_SOURCES = 1

          # Includes image from corpus in the answer.
          CORPUS_IMAGE_ONLY = 2

          # Triggers figure generation in the answer.
          FIGURE_GENERATION_ONLY = 3
        end
      end

      # Specification of the prompt to use with the model.
      # @!attribute [rw] preamble
      #   @return [::String]
      #     Text at the beginning of the prompt that instructs the assistant.
      #     Examples are available in the user guide.
      class ModelPromptSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Specification of the model.
      # @!attribute [rw] version
      #   @return [::String]
      #     The model version used to generate the summary.
      #
      #     Supported values are:
      #
      #     * `stable`: string. Default value when no value is specified. Uses a
      #        generally available, fine-tuned model. For more information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      #     * `preview`: string. (Public preview) Uses a preview model. For more
      #        information, see
      #        [Answer generation model versions and
      #        lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      class ModelSpec
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # A specification for configuring the extractive content in a search
    # response.
    # @!attribute [rw] max_extractive_answer_count
    #   @return [::Integer]
    #     The maximum number of extractive answers returned in each search
    #     result.
    #
    #     An extractive answer is a verbatim answer extracted from the original
    #     document, which provides a precise and contextually relevant answer to
    #     the search query.
    #
    #     If the number of matching answers is less than the
    #     `max_extractive_answer_count`, return all of the answers. Otherwise,
    #     return the `max_extractive_answer_count`.
    #
    #     At most five answers are returned for each
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult SearchResult}.
    # @!attribute [rw] max_extractive_segment_count
    #   @return [::Integer]
    #     The max number of extractive segments returned in each search result.
    #     Only applied if the
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} is set to
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}
    #     or
    #     {::Google::Cloud::DiscoveryEngine::V1beta::DataStore#solution_types DataStore.solution_types}
    #     is
    #     {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}.
    #
    #     An extractive segment is a text segment extracted from the original
    #     document that is relevant to the search query, and, in general, more
    #     verbose than an extractive answer. The segment could then be used as
    #     input for LLMs to generate summaries and answers.
    #
    #     If the number of matching segments is less than
    #     `max_extractive_segment_count`, return all of the segments. Otherwise,
    #     return the `max_extractive_segment_count`.
    # @!attribute [rw] return_extractive_segment_score
    #   @return [::Boolean]
    #     Specifies whether to return the confidence score from the extractive
    #     segments in each search result. This feature is available only for new
    #     or allowlisted data stores. To allowlist your data store,
    #     contact your Customer Engineer. The default value is `false`.
    # @!attribute [rw] num_previous_segments
    #   @return [::Integer]
    #     Specifies whether to also include the adjacent from each selected
    #     segments.
    #     Return at most `num_previous_segments` segments before each selected
    #     segments.
    # @!attribute [rw] num_next_segments
    #   @return [::Integer]
    #     Return at most `num_next_segments` segments after each selected
    #     segments.
    class ExtractiveContentSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the chunk spec to be returned from the search response.
    # Only available if the
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
    # is set to
    # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}
    # @!attribute [rw] num_previous_chunks
    #   @return [::Integer]
    #     The number of previous chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no previous chunks will be returned.
    # @!attribute [rw] num_next_chunks
    #   @return [::Integer]
    #     The number of next chunks to be returned of the current chunk. The
    #     maximum allowed value is 3.
    #     If not specified, no next chunks will be returned.
    class ChunkSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Specifies the search result mode. If unspecified, the
    # search result mode defaults to `DOCUMENTS`.
    module SearchResultMode
      # Default value.
      SEARCH_RESULT_MODE_UNSPECIFIED = 0

      # Returns documents in the search result.
      DOCUMENTS = 1

      # Returns chunks in the search result. Only available if the
      # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config}
      # is specified.
      CHUNKS = 2
    end
  end

  # The specification that uses customized query embedding vector to do
  # semantic document retrieval.
  # @!attribute [rw] embedding_vectors
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::EmbeddingSpec::EmbeddingVector>]
  #     The embedding vector used for retrieval. Limit to 1.
  class EmbeddingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Embedding vector.
    # @!attribute [rw] field_path
    #   @return [::String]
    #     Embedding field path in schema.
    # @!attribute [rw] vector
    #   @return [::Array<::Float>]
    #     Query embedding vector.
    class EmbeddingVector
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Specification to enable natural language understanding capabilities for
  # search requests.
  # @!attribute [rw] filter_extraction_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
  #     The condition under which filter extraction should occur.
  #     Server behavior defaults to `DISABLED`.
  # @!attribute [rw] geo_search_query_detection_field_names
  #   @return [::Array<::String>]
  #     Field names used for location-based filtering, where geolocation filters
  #     are detected in natural language search queries.
  #     Only valid when the FilterExtractionCondition is set to `ENABLED`.
  # @!attribute [rw] extracted_filter_behavior
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
  #     Optional. Controls behavior of how extracted filters are applied to the
  #     search. The default behavior depends on the request. For single datastore
  #     structured search, the default is `HARD_FILTER`. For multi-datastore
  #     search, the default behavior is `SOFT_BOOST`.
  #     Location-based filters are always applied as hard filters, and the
  #     `SOFT_BOOST` setting will not affect them.
  #     This field is only used if
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
  # @!attribute [rw] allowed_field_names
  #   @return [::Array<::String>]
  #     Optional. Allowlist of fields that can be used for natural language
  #     filter extraction. By default, if this is unspecified, all indexable
  #     fields are eligible for natural language filter extraction (but are not
  #     guaranteed to be used). If any fields are specified in
  #     allowed_field_names, only the fields that are both marked as indexable in
  #     the schema and specified in the allowlist will be eligible for natural
  #     language filter extraction. Note: for multi-datastore search, this is not
  #     yet supported, and will be ignored.
  class NaturalLanguageQueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition filter extraction should occur.
    module FilterExtractionCondition
      # Server behavior defaults to `DISABLED`.
      CONDITION_UNSPECIFIED = 0

      # Disables NL filter extraction.
      DISABLED = 1

      # Enables NL filter extraction.
      ENABLED = 2
    end

    # Enum describing how extracted filters are applied to the search.
    module ExtractedFilterBehavior
      # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
      # for extracted filters. For single datastore search, the default is to
      # apply as hard filters. For multi-datastore search, the default is to
      # apply as soft boosts.
      EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0

      # Applies all extracted filters as hard filters on the results. Results
      # that do not pass the extracted filters will not be returned in the
      # result set.
      HARD_FILTER = 1

      # Applies all extracted filters as soft boosts. Results that pass the
      # filters will be boosted up to higher ranks in the result set.
      SOFT_BOOST = 2
    end
  end

  # Specification for search as you type in search requests.
  # @!attribute [rw] condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition]
  #     The condition under which search as you type should occur.
  #     Default to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
  class SearchAsYouTypeSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition search as you type should occur.
    module Condition
      # Server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}.
      CONDITION_UNSPECIFIED = 0

      # Disables Search As You Type.
      DISABLED = 1

      # Enables Search As You Type.
      ENABLED = 2

      # Automatic switching between search-as-you-type and standard search
      # modes, ideal for single-API implementations (e.g., debouncing).
      AUTO = 3
    end
  end

  # Specifies features for display, like match highlighting.
  # @!attribute [rw] match_highlighting_condition
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::DisplaySpec::MatchHighlightingCondition]
  #     The condition under which match highlighting should occur.
  class DisplaySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing under which condition match highlighting should occur.
    module MatchHighlightingCondition
      # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`.
      MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0

      # Disables match highlighting on all documents.
      MATCH_HIGHLIGHTING_DISABLED = 1

      # Enables match highlighting on all documents.
      MATCH_HIGHLIGHTING_ENABLED = 2
    end
  end

  # Specification for crowding. Crowding improves the diversity of search
  # results by limiting the number of results that share the same field value.
  # For example, crowding on the color field with a max_count of 3 and mode
  # DROP_CROWDED_RESULTS will return at most 3 results with the same color
  # across all pages.
  # @!attribute [rw] field
  #   @return [::String]
  #     The field to use for crowding. Documents can be crowded by a field in the
  #     {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object. Crowding
  #     field is case sensitive.
  # @!attribute [rw] max_count
  #   @return [::Integer]
  #     The maximum number of documents to keep per value of the field. Once
  #     there are at least max_count previous results which contain the same
  #     value for the given field (according to the order specified in
  #     `order_by`), later results with the same value are "crowded away".
  #     If not specified, the default value is 1.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode]
  #     Mode to use for documents that are crowded away.
  class CrowdingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Enum describing the mode to use for documents that are crowded away.
    # They can be dropped or demoted to the later pages.
    module Mode
      # Unspecified crowding mode. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
      MODE_UNSPECIFIED = 0

      # Drop crowded results.
      DROP_CROWDED_RESULTS = 1

      # Demote crowded results to the later pages.
      DEMOTE_CROWDED_RESULTS_TO_END = 2
    end
  end

  # Session specification.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     If set, the search result gets stored to the "turn" specified by this
  #     query ID.
  #
  #     Example: Let's say the session looks like this:
  #       session {
  #         name: ".../sessions/xxx"
  #         turns {
  #           query { text: "What is foo?" query_id: ".../questions/yyy" }
  #           answer: "Foo is ..."
  #         }
  #         turns {
  #           query { text: "How about bar then?" query_id: ".../questions/zzz" }
  #         }
  #       }
  #
  #     The user can call /search API with a request like this:
  #
  #        session: ".../sessions/xxx"
  #        session_spec { query_id: ".../questions/zzz" }
  #
  #     Then, the API stores the search result, associated with the last turn.
  #     The stored search result can be used by a subsequent /answer API call
  #     (with the session ID and the query ID specified). Also, it is possible
  #     to call /search and /answer in parallel with the same session ID & query
  #     ID.
  # @!attribute [rw] search_result_persistence_count
  #   @return [::Integer]
  #     The number of top search results to persist. The persisted search results
  #     can be used for the subsequent /answer api call.
  #
  #     This field is similar to the `summary_result_count` field in
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}.
  #
  #     At most 10 results for documents mode, or 50 for chunks mode.
  class SessionSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Relevance filtering specification.
  # @!attribute [rw] keyword_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for keyword search.
  # @!attribute [rw] semantic_search_threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceFilterSpec::RelevanceThresholdSpec]
  #     Optional. Relevance filtering threshold specification for semantic
  #     search.
  class RelevanceFilterSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Specification for relevance filtering on a specific sub-search.
    # @!attribute [rw] relevance_threshold
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::RelevanceThreshold]
    #     Pre-defined relevance threshold for the sub-search.
    #
    #     Note: The following fields are mutually exclusive: `relevance_threshold`, `semantic_relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] semantic_relevance_threshold
    #   @return [::Float]
    #     Custom relevance threshold for the sub-search.
    #     The value must be in [0.0, 1.0].
    #
    #     Note: The following fields are mutually exclusive: `semantic_relevance_threshold`, `relevance_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RelevanceThresholdSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # The specification for personalization.
  # @!attribute [rw] mode
  #   @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode]
  #     The personalization mode of the search request.
  #     Defaults to
  #     {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
  class PersonalizationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The personalization mode of each search request.
    module Mode
      # Default value. In this case, server behavior defaults to
      # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}.
      MODE_UNSPECIFIED = 0

      # Personalization is enabled if data quality requirements are met.
      AUTO = 1

      # Disable personalization.
      DISABLED = 2
    end
  end

  # The specification for returning the document relevance score.
  # @!attribute [rw] return_relevance_score
  #   @return [::Boolean]
  #     Optional. Whether to return the relevance score for search results.
  #     The higher the score, the more relevant the document is to the query.
  class RelevanceScoreSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # SearchAddonSpec is used to disable add-ons for search as per new
  # repricing model. By default if the SearchAddonSpec is not specified, we
  # consider that the customer wants to enable them wherever applicable.
  # @!attribute [rw] disable_semantic_add_on
  #   @return [::Boolean]
  #     Optional. If true, semantic add-on is disabled. Semantic add-on includes
  #     embeddings and jetstream.
  # @!attribute [rw] disable_kpi_personalization_add_on
  #   @return [::Boolean]
  #     Optional. If true, disables event re-ranking and personalization to
  #     optimize KPIs & personalize results.
  # @!attribute [rw] disable_generative_answer_add_on
  #   @return [::Boolean]
  #     Optional. If true, generative answer add-on is disabled. Generative
  #     answer add-on includes natural language to filters and simple answers.
  class SearchAddonSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Configuration parameters for the Custom Ranking feature.
  # @!attribute [rw] expressions_to_precompute
  #   @return [::Array<::String>]
  #     Optional. A list of ranking expressions (see `ranking_expression` for the
  #     syntax documentation) to evaluate. The evaluation results will be
  #     returned in
  #     `SearchResponse.SearchResult.rank_signals.precomputed_expression_values`
  #     field.
  class CustomRankingParams
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

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

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

  # The backend to use for the ranking expression evaluation.
  module RankingExpressionBackend
    # Default option for unspecified/unknown values.
    RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0

    # Deprecated: Use `RANK_BY_EMBEDDING` instead.
    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
    # used instead.
    BYOE = 1

    # Deprecated: Use `RANK_BY_FORMULA` instead.
    # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
    # be used instead.
    CLEARBOX = 2

    # Ranking by custom embedding model, the default way to evaluate the
    # ranking expression.
    RANK_BY_EMBEDDING = 3

    # Ranking by custom formula.
    RANK_BY_FORMULA = 4
  end

  # The relevance threshold of the search results. The higher relevance
  # threshold is, the higher relevant results are shown and the less number of
  # results are returned.
  module RelevanceThreshold
    # Default value. In this case, server behavior defaults to Google defined
    # threshold.
    RELEVANCE_THRESHOLD_UNSPECIFIED = 0

    # Lowest relevance threshold.
    LOWEST = 1

    # Low relevance threshold.
    LOW = 2

    # Medium relevance threshold.
    MEDIUM = 3

    # High relevance threshold.
    HIGH = 4
  end
end