Class SearchRequest.SessionSpec (0.72.0) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 0.72.0keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   final   class  SearchRequest . SessionSpec   extends   GeneratedMessageV3   implements   SearchRequest . SessionSpecOrBuilder  
   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.
 Protobuf type google.cloud.discoveryengine.v1.SearchRequest.SessionSpec
    Inherited Members 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT) 
    
    
      com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int) 
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>) 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int) 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
   
  Static Fields
   
  QUERY_ID_FIELD_NUMBER 
  
    
public   static   final   int   QUERY_ID_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER 
  
    
public   static   final   int   SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER  
  
    
      
        Field Value  
      
        Type Description  
      
        int  
     
  
  Static Methods
   
  getDefaultInstance() 
  
    
public   static   SearchRequest . SessionSpec   getDefaultInstance ()  
  
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
  
  newBuilder() 
  
    
public   static   SearchRequest . SessionSpec . Builder   newBuilder ()  
  
  newBuilder(SearchRequest.SessionSpec prototype) 
  
    
public   static   SearchRequest . SessionSpec . Builder   newBuilder ( SearchRequest . SessionSpec   prototype )  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseDelimitedFrom ( InputStream   input )  
  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseDelimitedFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(byte[] data) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( byte []   data )  
  
    
      
        Parameter  
      
        Name Description  
      
        databyte [] 
     
  
  
  
  parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( byte []   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(ByteString data) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( ByteString   data )  
  
  
  
  parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( ByteString   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( CodedInputStream   input )  
  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( InputStream   input )  
  
  
  
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parseFrom(ByteBuffer data) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( ByteBuffer   data )  
  
  
  
  parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   SearchRequest . SessionSpec   parseFrom ( ByteBuffer   data ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  
  parser() 
  
    
public   static   Parser<SearchRequest . SessionSpec >  parser ()  
  
  Methods
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
  
    
      
        Parameter  
      
        Name Description  
      
        objObject  
     
  
  
  Overrides 
  
  getDefaultInstanceForType() 
  
    
public   SearchRequest . SessionSpec   getDefaultInstanceForType ()  
  
  getParserForType() 
  
    
public   Parser<SearchRequest . SessionSpec >  getParserForType ()  
  
  Overrides 
  
  getQueryId() 
  
    
public   String   getQueryId ()  
   If set, the search result gets stored to the "turn" specified by this
 query ID.
 Example: Let's say the session looks like this:
   session {
     name: ".../sessions/xxx"
     turns {
       query { text: "What is foo?" query_id: ".../questions/yyy" }
       answer: "Foo is ..."
     }
     turns {
       query { text: "How about bar then?" query_id: ".../questions/zzz" }
     }
   }
 The user can call /search API with a request like this:
session: ".../sessions/xxx"
session_spec { query_id: ".../questions/zzz" }
 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.
 string query_id = 1;
    
      
        Returns  
      
        Type Description  
      
        String The queryId.
 
     
  
  getQueryIdBytes() 
  
    
public   ByteString   getQueryIdBytes ()  
   If set, the search result gets stored to the "turn" specified by this
 query ID.
 Example: Let's say the session looks like this:
   session {
     name: ".../sessions/xxx"
     turns {
       query { text: "What is foo?" query_id: ".../questions/yyy" }
       answer: "Foo is ..."
     }
     turns {
       query { text: "How about bar then?" query_id: ".../questions/zzz" }
     }
   }
 The user can call /search API with a request like this:
session: ".../sessions/xxx"
session_spec { query_id: ".../questions/zzz" }
 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.
 string query_id = 1;
    
      
        Returns  
      
        Type Description  
      
        ByteString The bytes for queryId.
 
     
  
  getSearchResultPersistenceCount() 
  
    
public   int   getSearchResultPersistenceCount ()  
   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 .
 At most 10 results for documents mode, or 50 for chunks mode.
 optional int32 search_result_persistence_count = 2;
    
      
        Returns  
      
        Type Description  
      
        int The searchResultPersistenceCount.
 
     
  
  getSerializedSize() 
  
    
public   int   getSerializedSize ()  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  hasSearchResultPersistenceCount() 
  
    
public   boolean   hasSearchResultPersistenceCount ()  
   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 .
 At most 10 results for documents mode, or 50 for chunks mode.
 optional int32 search_result_persistence_count = 2;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the searchResultPersistenceCount field is set.
 
     
  
  hashCode() 
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
  
  Overrides 
  
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
  
  Overrides 
  
  newBuilderForType() 
  
    
public   SearchRequest . SessionSpec . Builder   newBuilderForType ()  
  
  newBuilderForType(GeneratedMessageV3.BuilderParent parent) 
  
    
protected   SearchRequest . SessionSpec . Builder   newBuilderForType ( GeneratedMessageV3 . BuilderParent   parent )  
  
  
  Overrides 
  
  newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) 
  
    
protected   Object   newInstance ( GeneratedMessageV3 . UnusedPrivateParameter   unused )  
  
  
    
      
        Returns  
      
        Type Description  
      
        Object  
     
  
  Overrides 
  
  toBuilder() 
  
    
public   SearchRequest . SessionSpec . Builder   toBuilder ()  
  
  writeTo(CodedOutputStream output) 
  
    
public   void   writeTo ( CodedOutputStream   output )  
  
  Overrides 
  
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
  
    
      [[["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-10-29 UTC."],[],[]]