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 v1 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.v1.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.v1.DataStore] is set to
[DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1.DataStore.ContentConfig.CONTENT_REQUIRED]
or
[DataStore.solution_types][google.cloud.discoveryengine.v1.DataStore.solution_types]
is
[SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1.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 page provides reference documentation for the \u003ccode\u003eSearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec\u003c/code\u003e class within the Discovery Engine v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExtractiveContentSpec\u003c/code\u003e class is a specification used to configure the extractive content in a search response, and is inherited from the object class.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the documentation is version 1.6.0, with several prior versions also documented on this page, along with their respective links.\u003c/p\u003e\n"],["\u003cp\u003eThis class includes properties such as \u003ccode\u003eMaxExtractiveAnswerCount\u003c/code\u003e, \u003ccode\u003eMaxExtractiveSegmentCount\u003c/code\u003e, \u003ccode\u003eNumNextSegments\u003c/code\u003e, \u003ccode\u003eNumPreviousSegments\u003c/code\u003e, and \u003ccode\u003eReturnExtractiveSegmentScore\u003c/code\u003e, which allow for configuration of extracted answers and segments.\u003c/p\u003e\n"],["\u003cp\u003eThe provided documentation is part of the .NET reference material for Google Cloud, focusing on the \u003ccode\u003eGoogle.Cloud.DiscoveryEngine.V1\u003c/code\u003e namespace and the \u003ccode\u003eGoogle.Cloud.DiscoveryEngine.V1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.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 v1 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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types.ExtractiveContentSpec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[ContentSearchSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.ContentSearchSpec.Types)[ExtractiveContentSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.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.v1.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.v1.DataStore\\] is set to\n\\[DataStore.ContentConfig.CONTENT_REQUIRED\\]\\[google.cloud.discoveryengine.v1.DataStore.ContentConfig.CONTENT_REQUIRED\\]\nor\n\\[DataStore.solution_types\\]\\[google.cloud.discoveryengine.v1.DataStore.solution_types\\]\nis\n\\[SOLUTION_TYPE_CHAT\\]\\[google.cloud.discoveryengine.v1.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`."]]