public sealed class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec : IMessage<SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec>, IEquatable<SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec>, IDeepCloneable<SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec.
A specification for configuring the extractive content in a search
response.
The maximum number of extractive answers returned in each search
result.
An extractive answer is a verbatim answer extracted from the original
document, which provides a precise and contextually relevant answer to
the search query.
If the number of matching answers is less than the
max_extractive_answer_count, return all of the answers. Otherwise,
return the max_extractive_answer_count.
At most five answers are returned for each
[SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult].
public int MaxExtractiveSegmentCount { get; set; }
The max number of extractive segments returned in each search result.
Only applied if the
[DataStore][google.cloud.discoveryengine.v1beta.DataStore] is set to
[DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1beta.DataStore.ContentConfig.CONTENT_REQUIRED]
or
[DataStore.solution_types][google.cloud.discoveryengine.v1beta.DataStore.solution_types]
is
[SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_CHAT].
An extractive segment is a text segment extracted from the original
document that is relevant to the search query, and, in general, more
verbose than an extractive answer. The segment could then be used as
input for LLMs to generate summaries and answers.
If the number of matching segments is less than
max_extractive_segment_count, return all of the segments. Otherwise,
return the max_extractive_segment_count.
Specifies whether to also include the adjacent from each selected
segments.
Return at most num_previous_segments segments before each selected
segments.
public bool ReturnExtractiveSegmentScore { get; set; }
Specifies whether to return the confidence score from the extractive
segments in each search result. This feature is available only for new
or allowlisted data stores. To allowlist your data store,
contact your Customer Engineer. The default value is false.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis documentation details the \u003ccode\u003eExtractiveContentSpec\u003c/code\u003e class, which is used to configure how extractive content is presented in search responses within the Discovery Engine v1beta API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExtractiveContentSpec\u003c/code\u003e class, part of the \u003ccode\u003eGoogle.Cloud.DiscoveryEngine.V1Beta\u003c/code\u003e namespace, allows users to set parameters like \u003ccode\u003eMaxExtractiveAnswerCount\u003c/code\u003e and \u003ccode\u003eMaxExtractiveSegmentCount\u003c/code\u003e to control the number of answers and segments returned.\u003c/p\u003e\n"],["\u003cp\u003eThe class is defined as public sealed, implements \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from \u003ccode\u003eobject\u003c/code\u003e, providing various functionalities for message handling and data manipulation.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify whether to return scores for extractive segments via the \u003ccode\u003eReturnExtractiveSegmentScore\u003c/code\u003e property, and control the inclusion of adjacent segments with \u003ccode\u003eNumNextSegments\u003c/code\u003e and \u003ccode\u003eNumPreviousSegments\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides the capability to get a certain number of segments before and after the result, using \u003ccode\u003eNumPreviousSegments\u003c/code\u003e and \u003ccode\u003eNumNextSegments\u003c/code\u003e respectively.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec (1.0.0-beta19)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta19 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec) \n\n public sealed class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec : IMessage\u003cSearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec\u003e, IEquatable\u003cSearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec\u003e, IDeepCloneable\u003cSearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec.\n\nA specification for configuring the extractive content in a search\nresponse. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1Beta](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1Beta.dll\n\nConstructors\n------------\n\n### ExtractiveContentSpec()\n\n public ExtractiveContentSpec()\n\n### ExtractiveContentSpec(ExtractiveContentSpec)\n\n public ExtractiveContentSpec(SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec other)\n\nProperties\n----------\n\n### MaxExtractiveAnswerCount\n\n public int MaxExtractiveAnswerCount { get; set; }\n\nThe maximum number of extractive answers returned in each search\nresult.\n\nAn extractive answer is a verbatim answer extracted from the original\ndocument, which provides a precise and contextually relevant answer to\nthe search query.\n\nIf the number of matching answers is less than the\n`max_extractive_answer_count`, return all of the answers. Otherwise,\nreturn the `max_extractive_answer_count`.\n\nAt most five answers are returned for each\n\\[SearchResult\\]\\[google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult\\].\n\n### MaxExtractiveSegmentCount\n\n public int MaxExtractiveSegmentCount { get; set; }\n\nThe max number of extractive segments returned in each search result.\nOnly applied if the\n\\[DataStore\\]\\[google.cloud.discoveryengine.v1beta.DataStore\\] is set to\n\\[DataStore.ContentConfig.CONTENT_REQUIRED\\]\\[google.cloud.discoveryengine.v1beta.DataStore.ContentConfig.CONTENT_REQUIRED\\]\nor\n\\[DataStore.solution_types\\]\\[google.cloud.discoveryengine.v1beta.DataStore.solution_types\\]\nis\n\\[SOLUTION_TYPE_CHAT\\]\\[google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_CHAT\\].\n\nAn extractive segment is a text segment extracted from the original\ndocument that is relevant to the search query, and, in general, more\nverbose than an extractive answer. The segment could then be used as\ninput for LLMs to generate summaries and answers.\n\nIf the number of matching segments is less than\n`max_extractive_segment_count`, return all of the segments. Otherwise,\nreturn the `max_extractive_segment_count`.\n\n### NumNextSegments\n\n public int NumNextSegments { get; set; }\n\nReturn at most `num_next_segments` segments after each selected\nsegments.\n\n### NumPreviousSegments\n\n public int NumPreviousSegments { get; set; }\n\nSpecifies whether to also include the adjacent from each selected\nsegments.\nReturn at most `num_previous_segments` segments before each selected\nsegments.\n\n### ReturnExtractiveSegmentScore\n\n public bool ReturnExtractiveSegmentScore { get; set; }\n\nSpecifies whether to return the confidence score from the extractive\nsegments in each search result. This feature is available only for new\nor allowlisted data stores. To allowlist your data store,\ncontact your Customer Engineer. The default value is `false`."]]