public sealed class SearchRequest.Types.SessionSpec : IMessage<SearchRequest.Types.SessionSpec>, IEquatable<SearchRequest.Types.SessionSpec>, IDeepCloneable<SearchRequest.Types.SessionSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.SessionSpec.
Session specification.
Multi-turn Search feature is currently at private GA stage. Please use
v1alpha or v1beta version instead before we launch this feature to public
GA. Or ask for allowlisting through Google Support team.
Then, the API stores the search result, associated with the last turn.
The stored search result can be used by a subsequent /answer API call
(with the session ID and the query ID specified). Also, it is possible
to call /search and /answer in parallel with the same session ID & query
ID.
public int SearchResultPersistenceCount { get; set; }
The number of top search results to persist. The persisted search results
can be used for the subsequent /answer api call.
This field is simliar to the summary_result_count field in
[SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count].
At most 10 results for documents mode, or 50 for chunks mode.
[[["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 is for the \u003ccode\u003eSearchRequest.Types.SessionSpec\u003c/code\u003e class within the Discovery Engine v1beta API, detailing its structure and functionality.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSessionSpec\u003c/code\u003e class is used for defining session specifications within search requests, and it 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.\u003c/p\u003e\n"],["\u003cp\u003eThe Multi-turn Search feature, which uses \u003ccode\u003eSessionSpec\u003c/code\u003e, is currently in a private GA stage and users should use v1alpha or v1beta versions or seek allowlisting via Google Support.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSessionSpec\u003c/code\u003e includes properties such as \u003ccode\u003eQueryId\u003c/code\u003e to link search results to specific turns in a session, and \u003ccode\u003eSearchResultPersistenceCount\u003c/code\u003e to define how many search results are stored for later use in \u003ccode\u003e/answer\u003c/code\u003e API calls.\u003c/p\u003e\n"],["\u003cp\u003eThe class has two constructors for creating new instances: one default and one that copies from an existing \u003ccode\u003eSessionSpec\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class SearchRequest.Types.SessionSpec (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.SessionSpec)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.SessionSpec) \n\n public sealed class SearchRequest.Types.SessionSpec : IMessage\u003cSearchRequest.Types.SessionSpec\u003e, IEquatable\u003cSearchRequest.Types.SessionSpec\u003e, IDeepCloneable\u003cSearchRequest.Types.SessionSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.SessionSpec.\n\nSession specification.\n\nMulti-turn Search feature is currently at private GA stage. Please use\nv1alpha or v1beta version instead before we launch this feature to public\nGA. Or ask for allowlisting through Google Support team. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SearchRequest.Types.SessionSpec \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)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.SessionSpec), [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)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.SessionSpec), [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)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.SessionSpec), [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### SessionSpec()\n\n public SessionSpec()\n\n### SessionSpec(SessionSpec)\n\n public SessionSpec(SearchRequest.Types.SessionSpec other)\n\nProperties\n----------\n\n### HasSearchResultPersistenceCount\n\n public bool HasSearchResultPersistenceCount { get; }\n\nGets whether the \"search_result_persistence_count\" field is set\n\n### QueryId\n\n public string QueryId { get; set; }\n\nIf set, the search result gets stored to the \"turn\" specified by this\nquery ID.\n\nExample: Let's say the session looks like this:\nsession {\nname: \".../sessions/xxx\"\nturns {\nquery { text: \"What is foo?\" query_id: \".../questions/yyy\" }\nanswer: \"Foo is ...\"\n}\nturns {\nquery { text: \"How about bar then?\" query_id: \".../questions/zzz\" }\n}\n}\n\nThe user can call /search API with a request like this:\n\nsession: \".../sessions/xxx\"\nsession_spec { query_id: \".../questions/zzz\" }\n\nThen, the API stores the search result, associated with the last turn.\nThe stored search result can be used by a subsequent /answer API call\n(with the session ID and the query ID specified). Also, it is possible\nto call /search and /answer in parallel with the same session ID \\& query\nID.\n\n### SearchResultPersistenceCount\n\n public int SearchResultPersistenceCount { get; set; }\n\nThe number of top search results to persist. The persisted search results\ncan be used for the subsequent /answer api call.\n\nThis field is simliar to the `summary_result_count` field in\n\\[SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count\\]\\[google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count\\].\n\nAt most 10 results for documents mode, or 50 for chunks mode."]]