Class SearchRequest.ContentSearchSpec.SnippetSpec.Builder (0.16.0)

public static final class SearchRequest.ContentSearchSpec.SnippetSpec.Builder extends GeneratedMessageV3.Builder<SearchRequest.ContentSearchSpec.SnippetSpec.Builder> implements SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder

The specification that configs the snippet in the search results.

Protobuf type google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public SearchRequest.ContentSearchSpec.SnippetSpec build()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec

buildPartial()

public SearchRequest.ContentSearchSpec.SnippetSpec buildPartial()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec

clear()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clear()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

clearMaxSnippetCount()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearMaxSnippetCount()

Max number of snippets returned in each search result.

A snippet is an infomartive summary of a content with highlighting for UI rendering.

If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count.

At most 5 snippets will be returned for each SearchResult.

int32 max_snippet_count = 1;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

clearReferenceOnly()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearReferenceOnly()

if true, only snippet reference is returned.

bool reference_only = 2;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

clone()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clone()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

getDefaultInstanceForType()

public SearchRequest.ContentSearchSpec.SnippetSpec getDefaultInstanceForType()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMaxSnippetCount()

public int getMaxSnippetCount()

Max number of snippets returned in each search result.

A snippet is an infomartive summary of a content with highlighting for UI rendering.

If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count.

At most 5 snippets will be returned for each SearchResult.

int32 max_snippet_count = 1;

Returns
TypeDescription
int

The maxSnippetCount.

getReferenceOnly()

public boolean getReferenceOnly()

if true, only snippet reference is returned.

bool reference_only = 2;

Returns
TypeDescription
boolean

The referenceOnly.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SearchRequest.ContentSearchSpec.SnippetSpec other)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder mergeFrom(SearchRequest.ContentSearchSpec.SnippetSpec other)
Parameter
NameDescription
otherSearchRequest.ContentSearchSpec.SnippetSpec
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.ContentSearchSpec.SnippetSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setMaxSnippetCount(int value)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder setMaxSnippetCount(int value)

Max number of snippets returned in each search result.

A snippet is an infomartive summary of a content with highlighting for UI rendering.

If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count.

At most 5 snippets will be returned for each SearchResult.

int32 max_snippet_count = 1;

Parameter
NameDescription
valueint

The maxSnippetCount to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

setReferenceOnly(boolean value)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder setReferenceOnly(boolean value)

if true, only snippet reference is returned.

bool reference_only = 2;

Parameter
NameDescription
valueboolean

The referenceOnly to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.ContentSearchSpec.SnippetSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides