# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec (v2.8.0)

2.8.0 (latest) 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.1 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec.

Session specification.


<br />

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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #query_id

    def query_id() -> ::String

**Returns**

- (::String) --- 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.

### #query_id=

    def query_id=(value) -> ::String

**Parameter**

- **value** (::String) --- 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.
**Returns**

- (::String) --- 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.

### #search_result_persistence_count

    def search_result_persistence_count() -> ::Integer

**Returns**

- (::Integer) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SearchRequest-ContentSearchSpec-SummarySpec#Google__Cloud__DiscoveryEngine__V1__SearchRequest__ContentSearchSpec__SummarySpec_summary_result_count_instance_ "Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count (method)").

  At most 10 results for documents mode, or 50 for chunks mode.

### #search_result_persistence_count=

    def search_result_persistence_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SearchRequest-ContentSearchSpec-SummarySpec#Google__Cloud__DiscoveryEngine__V1__SearchRequest__ContentSearchSpec__SummarySpec_summary_result_count_instance_ "Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count (method)").

  At most 10 results for documents mode, or 50 for chunks mode.
**Returns**

- (::Integer) --- 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SearchRequest-ContentSearchSpec-SummarySpec#Google__Cloud__DiscoveryEngine__V1__SearchRequest__ContentSearchSpec__SummarySpec_summary_result_count_instance_ "Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count (method)").

  At most 10 results for documents mode, or 50 for chunks mode.