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 v1 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 similar to the summary_result_count field in
[SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count][google.cloud.discoveryengine.v1.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\u003eThe latest version of the \u003ccode\u003eSearchRequest.Types.SessionSpec\u003c/code\u003e class is 1.6.0, which is part of the Google Cloud Discovery Engine v1 API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSearchRequest.Types.SessionSpec\u003c/code\u003e is a class that defines the session specification for search requests within the Discovery Engine API, and implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, and \u003ccode\u003eIDeepCloneable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows for storing search results to specific turns within a session using a query ID, which can be utilized by subsequent API calls like /answer.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSearchResultPersistenceCount\u003c/code\u003e property allows you to specify the number of top search results to be persisted for future use in /answer API calls, with limits of 10 for documents and 50 for chunks mode.\u003c/p\u003e\n"],["\u003cp\u003eThe Multi-turn Search feature is currently at private GA stage, so v1alpha or v1beta should be used, or you will need to ask for allowlisting through the Google Support team.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class SearchRequest.Types.SessionSpec (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.SessionSpec)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.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 v1 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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.SessionSpec), [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)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[SessionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.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### 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 similar to the `summary_result_count` field in\n\\[SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count\\]\\[google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count\\].\n\nAt most 10 results for documents mode, or 50 for chunks mode."]]