Class SearchRequest.SessionSpec.Builder (0.44.0)

public static final class SearchRequest.SessionSpec.Builder extends GeneratedMessageV3.Builder<SearchRequest.SessionSpec.Builder> 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.v1alpha.SearchRequest.SessionSpec

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SearchRequest.SessionSpec.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

build()

public SearchRequest.SessionSpec build()
Returns
Type Description
SearchRequest.SessionSpec

buildPartial()

public SearchRequest.SessionSpec buildPartial()
Returns
Type Description
SearchRequest.SessionSpec

clear()

public SearchRequest.SessionSpec.Builder clear()
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SearchRequest.SessionSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public SearchRequest.SessionSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

clearQueryId()

public SearchRequest.SessionSpec.Builder clearQueryId()

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
SearchRequest.SessionSpec.Builder

This builder for chaining.

clearSearchResultPersistenceCount()

public SearchRequest.SessionSpec.Builder clearSearchResultPersistenceCount()

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.

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

optional int32 search_result_persistence_count = 2;

Returns
Type Description
SearchRequest.SessionSpec.Builder

This builder for chaining.

clone()

public SearchRequest.SessionSpec.Builder clone()
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

getDefaultInstanceForType()

public SearchRequest.SessionSpec getDefaultInstanceForType()
Returns
Type Description
SearchRequest.SessionSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
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 simliar 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.

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 simliar 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.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SearchRequest.SessionSpec other)

public SearchRequest.SessionSpec.Builder mergeFrom(SearchRequest.SessionSpec other)
Parameter
Name Description
other SearchRequest.SessionSpec
Returns
Type Description
SearchRequest.SessionSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SearchRequest.SessionSpec.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SearchRequest.SessionSpec.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.SessionSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public SearchRequest.SessionSpec.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

setQueryId(String value)

public SearchRequest.SessionSpec.Builder setQueryId(String value)

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;

Parameter
Name Description
value String

The queryId to set.

Returns
Type Description
SearchRequest.SessionSpec.Builder

This builder for chaining.

setQueryIdBytes(ByteString value)

public SearchRequest.SessionSpec.Builder setQueryIdBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for queryId to set.

Returns
Type Description
SearchRequest.SessionSpec.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public SearchRequest.SessionSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

setSearchResultPersistenceCount(int value)

public SearchRequest.SessionSpec.Builder setSearchResultPersistenceCount(int value)

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.

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

optional int32 search_result_persistence_count = 2;

Parameter
Name Description
value int

The searchResultPersistenceCount to set.

Returns
Type Description
SearchRequest.SessionSpec.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.SessionSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides