Class Chunk (0.44.0)

public final class Chunk extends GeneratedMessageV3 implements ChunkOrBuilder

Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode.

Protobuf type google.cloud.discoveryengine.v1beta.Chunk

Implements

ChunkOrBuilder

Static Fields

CHUNK_METADATA_FIELD_NUMBER

public static final int CHUNK_METADATA_FIELD_NUMBER
Field Value
Type Description
int

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
Type Description
int

DERIVED_STRUCT_DATA_FIELD_NUMBER

public static final int DERIVED_STRUCT_DATA_FIELD_NUMBER
Field Value
Type Description
int

DOCUMENT_METADATA_FIELD_NUMBER

public static final int DOCUMENT_METADATA_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PAGE_SPAN_FIELD_NUMBER

public static final int PAGE_SPAN_FIELD_NUMBER
Field Value
Type Description
int

RELEVANCE_SCORE_FIELD_NUMBER

public static final int RELEVANCE_SCORE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Chunk getDefaultInstance()
Returns
Type Description
Chunk

getDescriptor()

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

newBuilder()

public static Chunk.Builder newBuilder()
Returns
Type Description
Chunk.Builder

newBuilder(Chunk prototype)

public static Chunk.Builder newBuilder(Chunk prototype)
Parameter
Name Description
prototype Chunk
Returns
Type Description
Chunk.Builder

parseDelimitedFrom(InputStream input)

public static Chunk parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Chunk parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Chunk parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Chunk parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Chunk parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Chunk parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Chunk parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Chunk parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Chunk parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Chunk parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Chunk parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Chunk parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Chunk> parser()
Returns
Type Description
Parser<Chunk>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getChunkMetadata()

public Chunk.ChunkMetadata getChunkMetadata()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.ChunkMetadata

The chunkMetadata.

getChunkMetadataOrBuilder()

public Chunk.ChunkMetadataOrBuilder getChunkMetadataOrBuilder()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.ChunkMetadataOrBuilder

getContent()

public String getContent()

Content is a string from a document (parsed content).

string content = 3;

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

Content is a string from a document (parsed content).

string content = 3;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public Chunk getDefaultInstanceForType()
Returns
Type Description
Chunk

getDerivedStructData()

public Struct getDerivedStructData()

Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.

.google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Struct

The derivedStructData.

getDerivedStructDataOrBuilder()

public StructOrBuilder getDerivedStructDataOrBuilder()

Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.

.google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
StructOrBuilder

getDocumentMetadata()

public Chunk.DocumentMetadata getDocumentMetadata()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.DocumentMetadata

The documentMetadata.

getDocumentMetadataOrBuilder()

public Chunk.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.DocumentMetadataOrBuilder

getId()

public String getId()

Unique chunk ID of the current chunk.

string id = 2;

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Unique chunk ID of the current chunk.

string id = 2;

Returns
Type Description
ByteString

The bytes for id.

getName()

public String getName()

The full resource name of the chunk. Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}.

This field must be a UTF-8 encoded string with a length limit of 1024 characters.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The full resource name of the chunk. Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}.

This field must be a UTF-8 encoded string with a length limit of 1024 characters.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getPageSpan()

public Chunk.PageSpan getPageSpan()

Page span of the chunk.

.google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.PageSpan

The pageSpan.

getPageSpanOrBuilder()

public Chunk.PageSpanOrBuilder getPageSpanOrBuilder()

Page span of the chunk.

.google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.PageSpanOrBuilder

getParserForType()

public Parser<Chunk> getParserForType()
Returns
Type Description
Parser<Chunk>
Overrides

getRelevanceScore()

public double getRelevanceScore()

Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on [SearchService.SearchResponse][].

optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
double

The relevanceScore.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasChunkMetadata()

public boolean hasChunkMetadata()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the chunkMetadata field is set.

hasDerivedStructData()

public boolean hasDerivedStructData()

Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.

.google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the derivedStructData field is set.

hasDocumentMetadata()

public boolean hasDocumentMetadata()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
boolean

Whether the documentMetadata field is set.

hasPageSpan()

public boolean hasPageSpan()

Page span of the chunk.

.google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;

Returns
Type Description
boolean

Whether the pageSpan field is set.

hasRelevanceScore()

public boolean hasRelevanceScore()

Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on [SearchService.SearchResponse][].

optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the relevanceScore field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Chunk.Builder newBuilderForType()
Returns
Type Description
Chunk.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Chunk.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Chunk.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Chunk.Builder toBuilder()
Returns
Type Description
Chunk.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException