public sealed class SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec : IMessage<SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec>, IEquatable<SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec>, IDeepCloneable<SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec.
A specification for configuring snippets in a search response.
[Obsolete]public int MaxSnippetCount { get; set; }
[DEPRECATED] This field is deprecated. To control snippet return, use
return_snippet field. For backwards compatibility, we will return
snippet if max_snippet_count > 0.
If true, then return snippet. If no snippet can be generated, we
return "No snippet is available for this page." A snippet_status with
SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.
[[["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 covers the \u003ccode\u003eSnippetSpec\u003c/code\u003e class within the Google Cloud Discovery Engine v1beta API, specifically version 1.0.0-beta18.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSnippetSpec\u003c/code\u003e class is designed to configure snippets in search responses and is part of the \u003ccode\u003eSearchRequest.Types.ContentSearchSpec.Types\u003c/code\u003e hierarchy.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, which enhance its functionality.\u003c/p\u003e\n"],["\u003cp\u003eIt includes constructors for creating instances of \u003ccode\u003eSnippetSpec\u003c/code\u003e, and properties like \u003ccode\u003eMaxSnippetCount\u003c/code\u003e, \u003ccode\u003eReferenceOnly\u003c/code\u003e, and \u003ccode\u003eReturnSnippet\u003c/code\u003e to configure the snippet generation behaviour, although \u003ccode\u003eMaxSnippetCount\u003c/code\u003e and \u003ccode\u003eReferenceOnly\u003c/code\u003e are deprecated.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReturnSnippet\u003c/code\u003e property determines if a snippet is returned in the search response, with a fallback message if no snippet is available.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec (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.SnippetSpec)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec) \n\n public sealed class SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec : IMessage\u003cSearchRequest.Types.ContentSearchSpec.Types.SnippetSpec\u003e, IEquatable\u003cSearchRequest.Types.ContentSearchSpec.Types.SnippetSpec\u003e, IDeepCloneable\u003cSearchRequest.Types.ContentSearchSpec.Types.SnippetSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec.\n\nA specification for configuring snippets in a search response. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec \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)[SnippetSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec), [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)[SnippetSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec), [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)[SnippetSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec), [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### SnippetSpec()\n\n public SnippetSpec()\n\n### SnippetSpec(SnippetSpec)\n\n public SnippetSpec(SearchRequest.Types.ContentSearchSpec.Types.SnippetSpec other)\n\nProperties\n----------\n\n### MaxSnippetCount\n\n [Obsolete]\n public int MaxSnippetCount { get; set; }\n\n\\[DEPRECATED\\] This field is deprecated. To control snippet return, use\n`return_snippet` field. For backwards compatibility, we will return\nsnippet if max_snippet_count \\\u003e 0.\n\n### ReferenceOnly\n\n [Obsolete]\n public bool ReferenceOnly { get; set; }\n\n\\[DEPRECATED\\] This field is deprecated and will have no affect on the\nsnippet.\n\n### ReturnSnippet\n\n public bool ReturnSnippet { get; set; }\n\nIf `true`, then return snippet. If no snippet can be generated, we\nreturn \"No snippet is available for this page.\" A `snippet_status` with\n`SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned."]]