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

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

Overview

Response message for SearchService.Search method.

Defined Under Namespace

Classes: Facet, QueryExpansionInfo, SearchResult, SessionInfo, Summary

Instance Attribute Summary collapse

Instance Attribute Details

#attribution_token::String

Returns A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.

Returns:

  • (::String)

    A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#corrected_query::String

Returns Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

Returns:

  • (::String)

    Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

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

Returns Results of facets requested by user.

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#next_page_token::String

Returns A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Returns:

  • (::String)

    A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

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

Returns Query expansion information for the returned results.

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#redirect_uri::String

Returns The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.

Returns:

  • (::String)

    The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

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

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

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

Returns Promotions for site search.

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#session_info::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo

Returns Session information.

Only set if SearchRequest.session is provided. See its description for more details.

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

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

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

Returns:



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#total_size::Integer

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

Returns:

  • (::Integer)

    The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.



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
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1247

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

  # Represents the search results.
  # @!attribute [rw] id
  #   @return [::String]
  #     {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
  #     searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
  # @!attribute [rw] document
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Document]
  #     The document data snippet in the search response. Only fields that are
  #     marked as `retrievable` are populated.
  # @!attribute [rw] chunk
  #   @return [::Google::Cloud::DiscoveryEngine::V1::Chunk]
  #     The chunk data in the search response if the
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode}
  #     is set to
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}.
  # @!attribute [r] model_scores
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}]
  #     Output only. Google provided available scores.
  # @!attribute [rw] rank_signals
  #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
  #     A set of ranking signals associated with the result.
  class SearchResult
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
    class ModelScoresEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # A set of ranking signals.
    # @!attribute [rw] keyword_similarity_score
    #   @return [::Float]
    #     Keyword matching adjustment.
    # @!attribute [rw] relevance_score
    #   @return [::Float]
    #     Semantic relevance adjustment.
    # @!attribute [rw] semantic_similarity_score
    #   @return [::Float]
    #     Semantic similarity adjustment.
    # @!attribute [rw] pctr_rank
    #   @return [::Float]
    #     Predicted conversion rate adjustment as a rank.
    # @!attribute [rw] topicality_rank
    #   @return [::Float]
    #     Topicality adjustment as a rank.
    # @!attribute [rw] document_age
    #   @return [::Float]
    #     Age of the document in hours.
    # @!attribute [rw] boosting_factor
    #   @return [::Float]
    #     Combined custom boosts for a doc.
    # @!attribute [rw] default_rank
    #   @return [::Float]
    #     The default rank of the result.
    # @!attribute [rw] custom_signals
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
    #     A list of custom clearbox signals.
    class RankSignals
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Custom clearbox signal represented by name and value pair.
      # @!attribute [rw] name
      #   @return [::String]
      #     Name of the signal.
      # @!attribute [rw] value
      #   @return [::Float]
      #     Float value representing the ranking signal (e.g. 1.25 for BM25).
      class CustomSignal
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # A facet result.
  # @!attribute [rw] key
  #   @return [::String]
  #     The key for this facet. For example, `"colors"` or `"price"`. It matches
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
  # @!attribute [rw] values
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
  #     The facet values for this field.
  # @!attribute [rw] dynamic_facet
  #   @return [::Boolean]
  #     Whether the facet is dynamically generated.
  class Facet
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A facet value which contains value names and their count.
    # @!attribute [rw] value
    #   @return [::String]
    #     Text value of a facet, such as "Black" for facet "colors".
    #
    #     Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] interval
    #   @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
    #     Interval value for a facet, such as [10, 20) for facet "price". It
    #     matches
    #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
    #
    #     Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [rw] count
    #   @return [::Integer]
    #     Number of items that have this facet value.
    class FacetValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

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

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

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

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

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

    # Document reference.
    # @!attribute [rw] title
    #   @return [::String]
    #     Title of the document.
    # @!attribute [rw] document
    #   @return [::String]
    #     Required.
    #     {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the
    #     document. Full resource name of the referenced document, in the format
    #     `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
    # @!attribute [rw] uri
    #   @return [::String]
    #     Cloud Storage or HTTP uri for the document.
    # @!attribute [rw] chunk_contents
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>]
    #     List of cited chunk contents derived from document content.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Chunk content.
      # @!attribute [rw] content
      #   @return [::String]
      #     Chunk textual content.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      class ChunkContent
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

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

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

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

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

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

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

      # The LLM addon not enabled case.
      #
      # Google skips the summary if the LLM addon is not enabled.
      LLM_ADDON_NOT_ENABLED = 5

      # The no relevant content case.
      #
      # Google skips the summary if there is no relevant content in the
      # retrieved search results.
      NO_RELEVANT_CONTENT = 6

      # The jail-breaking query ignored case.
      #
      # For example, "Reply in the tone of a competing company's CEO".
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
      # is set to `true`.
      JAIL_BREAKING_QUERY_IGNORED = 7

      # The customer policy violation case.
      #
      # Google skips the summary if there is a customer policy violation
      # detected. The policy is defined by the customer.
      CUSTOMER_POLICY_VIOLATION = 8

      # The non-answer seeking query ignored case.
      #
      # Google skips the summary if the query doesn't have clear intent.
      # Only used when
      # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query]
      # is set to `true`.
      NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9

      # The time out case.
      #
      # Google skips the summary if the time out.
      TIME_OUT = 10
    end
  end

  # Information describing query expansion including whether expansion has
  # occurred.
  # @!attribute [rw] expanded_query
  #   @return [::Boolean]
  #     Bool describing whether query expansion has occurred.
  # @!attribute [rw] pinned_result_count
  #   @return [::Integer]
  #     Number of pinned results. This field will only be set when expansion
  #     happens and
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
  #     is set to true.
  class QueryExpansionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Information about the session.
  # @!attribute [rw] name
  #   @return [::String]
  #     Name of the session.
  #     If the auto-session mode is used (when
  #     {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session}
  #     ends with "-"), this field holds the newly generated session name.
  # @!attribute [rw] query_id
  #   @return [::String]
  #     Query ID that corresponds to this search API call.
  #     One session can have multiple turns, each with a unique query ID.
  #
  #     By specifying the session name and this query ID in the Answer API call,
  #     the answer generation happens in the context of the search results from
  #     this search call.
  class SessionInfo
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end