Class SearchRequest.ContentSearchSpec.SnippetSpec.Builder (0.28.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
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() (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=304

[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
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() (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=308

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

bool reference_only = 2 [deprecated = true];

Returns
TypeDescription
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
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() (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=304

[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
TypeDescription
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=308

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

bool reference_only = 2 [deprecated = true];

Returns
TypeDescription
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
TypeDescription
boolean

The returnSnippet.

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) (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=304

[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
NameDescription
valueint

The maxSnippetCount to set.

Returns
TypeDescription
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=308

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

bool reference_only = 2 [deprecated = true];

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

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
NameDescription
valueboolean

The returnSnippet to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.SnippetSpec.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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