Class SearchRequest.ContentSearchSpec.SnippetSpec.Builder (0.51.0)

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

A specification for configuring snippets in a search response.

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

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public SearchRequest.ContentSearchSpec.SnippetSpec build()
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec

buildPartial()

public SearchRequest.ContentSearchSpec.SnippetSpec buildPartial()
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec

clear()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clear()
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

clearMaxSnippetCount() (deprecated)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearMaxSnippetCount()

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=439

[DEPRECATED] This field is deprecated. To control snippet return, use return_snippet field. For backwards compatibility, we will return snippet if max_snippet_count > 0.

int32 max_snippet_count = 1 [deprecated = true];

Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearReferenceOnly() (deprecated)

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearReferenceOnly()

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=443

[DEPRECATED] This field is deprecated and will have no affect on the snippet.

bool reference_only = 2 [deprecated = true];

Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

clearReturnSnippet()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clearReturnSnippet()

If true, then return snippet. If no snippet can be generated, we return "No snippet is available for this page." A snippet_status with SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.

bool return_snippet = 3;

Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

clone()

public SearchRequest.ContentSearchSpec.SnippetSpec.Builder clone()
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

getDefaultInstanceForType()

public SearchRequest.ContentSearchSpec.SnippetSpec getDefaultInstanceForType()
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMaxSnippetCount() (deprecated)

public int getMaxSnippetCount()

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=439

[DEPRECATED] This field is deprecated. To control snippet return, use return_snippet field. For backwards compatibility, we will return snippet if max_snippet_count > 0.

int32 max_snippet_count = 1 [deprecated = true];

Returns
Type Description
int

The maxSnippetCount.

getReferenceOnly() (deprecated)

public boolean getReferenceOnly()

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=443

[DEPRECATED] This field is deprecated and will have no affect on the snippet.

bool reference_only = 2 [deprecated = true];

Returns
Type Description
boolean

The referenceOnly.

getReturnSnippet()

public boolean getReturnSnippet()

If true, then return snippet. If no snippet can be generated, we return "No snippet is available for this page." A snippet_status with SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.

bool return_snippet = 3;

Returns
Type Description
boolean

The returnSnippet.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SearchRequest.ContentSearchSpec.SnippetSpec other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setMaxSnippetCount(int value) (deprecated)

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

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=439

[DEPRECATED] This field is deprecated. To control snippet return, use return_snippet field. For backwards compatibility, we will return snippet if max_snippet_count > 0.

int32 max_snippet_count = 1 [deprecated = true];

Parameter
Name Description
value int

The maxSnippetCount to set.

Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

setReferenceOnly(boolean value) (deprecated)

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

Deprecated. google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=443

[DEPRECATED] This field is deprecated and will have no affect on the snippet.

bool reference_only = 2 [deprecated = true];

Parameter
Name Description
value boolean

The referenceOnly to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder
Overrides

setReturnSnippet(boolean value)

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

If true, then return snippet. If no snippet can be generated, we return "No snippet is available for this page." A snippet_status with SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.

bool return_snippet = 3;

Parameter
Name Description
value boolean

The returnSnippet to set.

Returns
Type Description
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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