Class SearchResponse.Builder (0.13.0)

public static final class SearchResponse.Builder extends GeneratedMessageV3.Builder<SearchResponse.Builder> implements SearchResponseOrBuilder

Response message for SearchService.Search method.

Protobuf type google.cloud.discoveryengine.v1beta.SearchResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllAppliedControls(Iterable<String> values)

public SearchResponse.Builder addAllAppliedControls(Iterable<String> values)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameter
NameDescription
valuesIterable<String>

The appliedControls to add.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

addAllFacets(Iterable<? extends SearchResponse.Facet> values)

public SearchResponse.Builder addAllFacets(Iterable<? extends SearchResponse.Facet> values)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.discoveryengine.v1beta.SearchResponse.Facet>
Returns
TypeDescription
SearchResponse.Builder

addAllResults(Iterable<? extends SearchResponse.SearchResult> values)

public SearchResponse.Builder addAllResults(Iterable<? extends SearchResponse.SearchResult> values)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult>
Returns
TypeDescription
SearchResponse.Builder

addAppliedControls(String value)

public SearchResponse.Builder addAppliedControls(String value)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameter
NameDescription
valueString

The appliedControls to add.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

addAppliedControlsBytes(ByteString value)

public SearchResponse.Builder addAppliedControlsBytes(ByteString value)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameter
NameDescription
valueByteString

The bytes of the appliedControls to add.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

addFacets(SearchResponse.Facet value)

public SearchResponse.Builder addFacets(SearchResponse.Facet value)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
valueSearchResponse.Facet
Returns
TypeDescription
SearchResponse.Builder

addFacets(SearchResponse.Facet.Builder builderForValue)

public SearchResponse.Builder addFacets(SearchResponse.Facet.Builder builderForValue)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
builderForValueSearchResponse.Facet.Builder
Returns
TypeDescription
SearchResponse.Builder

addFacets(int index, SearchResponse.Facet value)

public SearchResponse.Builder addFacets(int index, SearchResponse.Facet value)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameters
NameDescription
indexint
valueSearchResponse.Facet
Returns
TypeDescription
SearchResponse.Builder

addFacets(int index, SearchResponse.Facet.Builder builderForValue)

public SearchResponse.Builder addFacets(int index, SearchResponse.Facet.Builder builderForValue)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameters
NameDescription
indexint
builderForValueSearchResponse.Facet.Builder
Returns
TypeDescription
SearchResponse.Builder

addFacetsBuilder()

public SearchResponse.Facet.Builder addFacetsBuilder()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
SearchResponse.Facet.Builder

addFacetsBuilder(int index)

public SearchResponse.Facet.Builder addFacetsBuilder(int index)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.Facet.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SearchResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SearchResponse.Builder
Overrides

addResults(SearchResponse.SearchResult value)

public SearchResponse.Builder addResults(SearchResponse.SearchResult value)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
valueSearchResponse.SearchResult
Returns
TypeDescription
SearchResponse.Builder

addResults(SearchResponse.SearchResult.Builder builderForValue)

public SearchResponse.Builder addResults(SearchResponse.SearchResult.Builder builderForValue)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
builderForValueSearchResponse.SearchResult.Builder
Returns
TypeDescription
SearchResponse.Builder

addResults(int index, SearchResponse.SearchResult value)

public SearchResponse.Builder addResults(int index, SearchResponse.SearchResult value)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameters
NameDescription
indexint
valueSearchResponse.SearchResult
Returns
TypeDescription
SearchResponse.Builder

addResults(int index, SearchResponse.SearchResult.Builder builderForValue)

public SearchResponse.Builder addResults(int index, SearchResponse.SearchResult.Builder builderForValue)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameters
NameDescription
indexint
builderForValueSearchResponse.SearchResult.Builder
Returns
TypeDescription
SearchResponse.Builder

addResultsBuilder()

public SearchResponse.SearchResult.Builder addResultsBuilder()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
SearchResponse.SearchResult.Builder

addResultsBuilder(int index)

public SearchResponse.SearchResult.Builder addResultsBuilder(int index)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.SearchResult.Builder

build()

public SearchResponse build()
Returns
TypeDescription
SearchResponse

buildPartial()

public SearchResponse buildPartial()
Returns
TypeDescription
SearchResponse

clear()

public SearchResponse.Builder clear()
Returns
TypeDescription
SearchResponse.Builder
Overrides

clearAppliedControls()

public SearchResponse.Builder clearAppliedControls()

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

clearAttributionToken()

public SearchResponse.Builder clearAttributionToken()

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

string attribution_token = 4;

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

clearCorrectedQuery()

public SearchResponse.Builder clearCorrectedQuery()

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

string corrected_query = 7;

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

clearFacets()

public SearchResponse.Builder clearFacets()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
SearchResponse.Builder

clearField(Descriptors.FieldDescriptor field)

public SearchResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
SearchResponse.Builder
Overrides

clearGuidedSearchResult()

public SearchResponse.Builder clearGuidedSearchResult()

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Returns
TypeDescription
SearchResponse.Builder

clearNextPageToken()

public SearchResponse.Builder clearNextPageToken()

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

string next_page_token = 5;

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SearchResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
SearchResponse.Builder
Overrides

clearResults()

public SearchResponse.Builder clearResults()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
SearchResponse.Builder

clearSummary()

public SearchResponse.Builder clearSummary()

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Returns
TypeDescription
SearchResponse.Builder

clearTotalSize()

public SearchResponse.Builder clearTotalSize()

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

int32 total_size = 3;

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

clone()

public SearchResponse.Builder clone()
Returns
TypeDescription
SearchResponse.Builder
Overrides

getAppliedControls(int index)

public String getAppliedControls(int index)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The appliedControls at the given index.

getAppliedControlsBytes(int index)

public ByteString getAppliedControlsBytes(int index)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the appliedControls at the given index.

getAppliedControlsCount()

public int getAppliedControlsCount()

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Returns
TypeDescription
int

The count of appliedControls.

getAppliedControlsList()

public ProtocolStringList getAppliedControlsList()

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Returns
TypeDescription
ProtocolStringList

A list containing the appliedControls.

getAttributionToken()

public String getAttributionToken()

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

string attribution_token = 4;

Returns
TypeDescription
String

The attributionToken.

getAttributionTokenBytes()

public ByteString getAttributionTokenBytes()

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

string attribution_token = 4;

Returns
TypeDescription
ByteString

The bytes for attributionToken.

getCorrectedQuery()

public String getCorrectedQuery()

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

string corrected_query = 7;

Returns
TypeDescription
String

The correctedQuery.

getCorrectedQueryBytes()

public ByteString getCorrectedQueryBytes()

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

string corrected_query = 7;

Returns
TypeDescription
ByteString

The bytes for correctedQuery.

getDefaultInstanceForType()

public SearchResponse getDefaultInstanceForType()
Returns
TypeDescription
SearchResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFacets(int index)

public SearchResponse.Facet getFacets(int index)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.Facet

getFacetsBuilder(int index)

public SearchResponse.Facet.Builder getFacetsBuilder(int index)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.Facet.Builder

getFacetsBuilderList()

public List<SearchResponse.Facet.Builder> getFacetsBuilderList()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
List<Builder>

getFacetsCount()

public int getFacetsCount()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
int

getFacetsList()

public List<SearchResponse.Facet> getFacetsList()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
List<Facet>

getFacetsOrBuilder(int index)

public SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.FacetOrBuilder

getFacetsOrBuilderList()

public List<? extends SearchResponse.FacetOrBuilder> getFacetsOrBuilderList()

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Returns
TypeDescription
List<? extends com.google.cloud.discoveryengine.v1beta.SearchResponse.FacetOrBuilder>

getGuidedSearchResult()

public SearchResponse.GuidedSearchResult getGuidedSearchResult()

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Returns
TypeDescription
SearchResponse.GuidedSearchResult

The guidedSearchResult.

getGuidedSearchResultBuilder()

public SearchResponse.GuidedSearchResult.Builder getGuidedSearchResultBuilder()

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Returns
TypeDescription
SearchResponse.GuidedSearchResult.Builder

getGuidedSearchResultOrBuilder()

public SearchResponse.GuidedSearchResultOrBuilder getGuidedSearchResultOrBuilder()

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Returns
TypeDescription
SearchResponse.GuidedSearchResultOrBuilder

getNextPageToken()

public String getNextPageToken()

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

string next_page_token = 5;

Returns
TypeDescription
String

The nextPageToken.

getNextPageTokenBytes()

public ByteString getNextPageTokenBytes()

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

string next_page_token = 5;

Returns
TypeDescription
ByteString

The bytes for nextPageToken.

getResults(int index)

public SearchResponse.SearchResult getResults(int index)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.SearchResult

getResultsBuilder(int index)

public SearchResponse.SearchResult.Builder getResultsBuilder(int index)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.SearchResult.Builder

getResultsBuilderList()

public List<SearchResponse.SearchResult.Builder> getResultsBuilderList()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
List<Builder>

getResultsCount()

public int getResultsCount()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
int

getResultsList()

public List<SearchResponse.SearchResult> getResultsList()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
List<SearchResult>

getResultsOrBuilder(int index)

public SearchResponse.SearchResultOrBuilder getResultsOrBuilder(int index)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.SearchResultOrBuilder

getResultsOrBuilderList()

public List<? extends SearchResponse.SearchResultOrBuilder> getResultsOrBuilderList()

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Returns
TypeDescription
List<? extends com.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResultOrBuilder>

getSummary()

public SearchResponse.Summary getSummary()

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Returns
TypeDescription
SearchResponse.Summary

The summary.

getSummaryBuilder()

public SearchResponse.Summary.Builder getSummaryBuilder()

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Returns
TypeDescription
SearchResponse.Summary.Builder

getSummaryOrBuilder()

public SearchResponse.SummaryOrBuilder getSummaryOrBuilder()

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Returns
TypeDescription
SearchResponse.SummaryOrBuilder

getTotalSize()

public int getTotalSize()

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

int32 total_size = 3;

Returns
TypeDescription
int

The totalSize.

hasGuidedSearchResult()

public boolean hasGuidedSearchResult()

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Returns
TypeDescription
boolean

Whether the guidedSearchResult field is set.

hasSummary()

public boolean hasSummary()

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Returns
TypeDescription
boolean

Whether the summary field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SearchResponse other)

public SearchResponse.Builder mergeFrom(SearchResponse other)
Parameter
NameDescription
otherSearchResponse
Returns
TypeDescription
SearchResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SearchResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public SearchResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
SearchResponse.Builder
Overrides

mergeGuidedSearchResult(SearchResponse.GuidedSearchResult value)

public SearchResponse.Builder mergeGuidedSearchResult(SearchResponse.GuidedSearchResult value)

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Parameter
NameDescription
valueSearchResponse.GuidedSearchResult
Returns
TypeDescription
SearchResponse.Builder

mergeSummary(SearchResponse.Summary value)

public SearchResponse.Builder mergeSummary(SearchResponse.Summary value)

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Parameter
NameDescription
valueSearchResponse.Summary
Returns
TypeDescription
SearchResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SearchResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchResponse.Builder
Overrides

removeFacets(int index)

public SearchResponse.Builder removeFacets(int index)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.Builder

removeResults(int index)

public SearchResponse.Builder removeResults(int index)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SearchResponse.Builder

setAppliedControls(int index, String value)

public SearchResponse.Builder setAppliedControls(int index, String value)

Controls applied as part of the Control service.

repeated string applied_controls = 10;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The appliedControls to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setAttributionToken(String value)

public SearchResponse.Builder setAttributionToken(String value)

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

string attribution_token = 4;

Parameter
NameDescription
valueString

The attributionToken to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setAttributionTokenBytes(ByteString value)

public SearchResponse.Builder setAttributionTokenBytes(ByteString value)

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

string attribution_token = 4;

Parameter
NameDescription
valueByteString

The bytes for attributionToken to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setCorrectedQuery(String value)

public SearchResponse.Builder setCorrectedQuery(String value)

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

string corrected_query = 7;

Parameter
NameDescription
valueString

The correctedQuery to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setCorrectedQueryBytes(ByteString value)

public SearchResponse.Builder setCorrectedQueryBytes(ByteString value)

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

string corrected_query = 7;

Parameter
NameDescription
valueByteString

The bytes for correctedQuery to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setFacets(int index, SearchResponse.Facet value)

public SearchResponse.Builder setFacets(int index, SearchResponse.Facet value)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameters
NameDescription
indexint
valueSearchResponse.Facet
Returns
TypeDescription
SearchResponse.Builder

setFacets(int index, SearchResponse.Facet.Builder builderForValue)

public SearchResponse.Builder setFacets(int index, SearchResponse.Facet.Builder builderForValue)

Results of facets requested by user.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Facet facets = 2;

Parameters
NameDescription
indexint
builderForValueSearchResponse.Facet.Builder
Returns
TypeDescription
SearchResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public SearchResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SearchResponse.Builder
Overrides

setGuidedSearchResult(SearchResponse.GuidedSearchResult value)

public SearchResponse.Builder setGuidedSearchResult(SearchResponse.GuidedSearchResult value)

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Parameter
NameDescription
valueSearchResponse.GuidedSearchResult
Returns
TypeDescription
SearchResponse.Builder

setGuidedSearchResult(SearchResponse.GuidedSearchResult.Builder builderForValue)

public SearchResponse.Builder setGuidedSearchResult(SearchResponse.GuidedSearchResult.Builder builderForValue)

Guided search result.

.google.cloud.discoveryengine.v1beta.SearchResponse.GuidedSearchResult guided_search_result = 8;

Parameter
NameDescription
builderForValueSearchResponse.GuidedSearchResult.Builder
Returns
TypeDescription
SearchResponse.Builder

setNextPageToken(String value)

public SearchResponse.Builder setNextPageToken(String value)

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

string next_page_token = 5;

Parameter
NameDescription
valueString

The nextPageToken to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setNextPageTokenBytes(ByteString value)

public SearchResponse.Builder setNextPageTokenBytes(ByteString value)

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

string next_page_token = 5;

Parameter
NameDescription
valueByteString

The bytes for nextPageToken to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

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

public SearchResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
SearchResponse.Builder
Overrides

setResults(int index, SearchResponse.SearchResult value)

public SearchResponse.Builder setResults(int index, SearchResponse.SearchResult value)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameters
NameDescription
indexint
valueSearchResponse.SearchResult
Returns
TypeDescription
SearchResponse.Builder

setResults(int index, SearchResponse.SearchResult.Builder builderForValue)

public SearchResponse.Builder setResults(int index, SearchResponse.SearchResult.Builder builderForValue)

A list of matched documents. The order represents the ranking.

repeated .google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult results = 1;

Parameters
NameDescription
indexint
builderForValueSearchResponse.SearchResult.Builder
Returns
TypeDescription
SearchResponse.Builder

setSummary(SearchResponse.Summary value)

public SearchResponse.Builder setSummary(SearchResponse.Summary value)

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Parameter
NameDescription
valueSearchResponse.Summary
Returns
TypeDescription
SearchResponse.Builder

setSummary(SearchResponse.Summary.Builder builderForValue)

public SearchResponse.Builder setSummary(SearchResponse.Summary.Builder builderForValue)

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 9;

Parameter
NameDescription
builderForValueSearchResponse.Summary.Builder
Returns
TypeDescription
SearchResponse.Builder

setTotalSize(int value)

public SearchResponse.Builder setTotalSize(int value)

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

int32 total_size = 3;

Parameter
NameDescription
valueint

The totalSize to set.

Returns
TypeDescription
SearchResponse.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final SearchResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchResponse.Builder
Overrides