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.v1.Chunk
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
ANNOTATION_CONTENTS_FIELD_NUMBER
public static final int ANNOTATION_CONTENTS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int ANNOTATION_METADATA_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
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 |
|
DATA_URLS_FIELD_NUMBER
public static final int DATA_URLS_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 |
|
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()
newBuilder()
public static Chunk.Builder newBuilder()
newBuilder(Chunk prototype)
public static Chunk.Builder newBuilder(Chunk prototype)
Parameter |
Name |
Description |
prototype |
Chunk
|
public static Chunk parseDelimitedFrom(InputStream input)
Returns |
Type |
Description |
Chunk |
|
public static Chunk parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
parseFrom(byte[] data)
public static Chunk parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
Returns |
Type |
Description |
Chunk |
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Chunk parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
parseFrom(ByteString data)
public static Chunk parseFrom(ByteString data)
Returns |
Type |
Description |
Chunk |
|
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Chunk parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
public static Chunk parseFrom(CodedInputStream input)
Returns |
Type |
Description |
Chunk |
|
public static Chunk parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
public static Chunk parseFrom(InputStream input)
Returns |
Type |
Description |
Chunk |
|
public static Chunk parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
parseFrom(ByteBuffer data)
public static Chunk parseFrom(ByteBuffer data)
Returns |
Type |
Description |
Chunk |
|
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Chunk parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Returns |
Type |
Description |
Chunk |
|
parser()
public static Parser<Chunk> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getAnnotationContents(int index)
public String getAnnotationContents(int index)
Output only. Annotation contents if the current chunk contains annotations.
repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
String |
The annotationContents at the given index.
|
getAnnotationContentsBytes(int index)
public ByteString getAnnotationContentsBytes(int index)
Output only. Annotation contents if the current chunk contains annotations.
repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
The index of the value to return.
|
Returns |
Type |
Description |
ByteString |
The bytes of the annotationContents at the given index.
|
getAnnotationContentsCount()
public int getAnnotationContentsCount()
Output only. Annotation contents if the current chunk contains annotations.
repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns |
Type |
Description |
int |
The count of annotationContents.
|
getAnnotationContentsList()
public ProtocolStringList getAnnotationContentsList()
Output only. Annotation contents if the current chunk contains annotations.
repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
public Chunk.AnnotationMetadata getAnnotationMetadata(int index)
Output only. The annotation metadata includes structured content in the
current chunk.
repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
|
public int getAnnotationMetadataCount()
Output only. The annotation metadata includes structured content in the
current chunk.
repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns |
Type |
Description |
int |
|
public List<Chunk.AnnotationMetadata> getAnnotationMetadataList()
Output only. The annotation metadata includes structured content in the
current chunk.
repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
public Chunk.AnnotationMetadataOrBuilder getAnnotationMetadataOrBuilder(int index)
Output only. The annotation metadata includes structured content in the
current chunk.
repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
|
public List<? extends Chunk.AnnotationMetadataOrBuilder> getAnnotationMetadataOrBuilderList()
Output only. The annotation metadata includes structured content in the
current chunk.
repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns |
Type |
Description |
List<? extends com.google.cloud.discoveryengine.v1.Chunk.AnnotationMetadataOrBuilder> |
|
public Chunk.ChunkMetadata getChunkMetadata()
Output only. Metadata of the current chunk.
.google.cloud.discoveryengine.v1.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
public Chunk.ChunkMetadataOrBuilder getChunkMetadataOrBuilder()
Output only. Metadata of the current chunk.
.google.cloud.discoveryengine.v1.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
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.
|
getDataUrls(int index)
public String getDataUrls(int index)
Output only. Image Data URLs if the current chunk contains images.
Data URLs are composed of four parts: a prefix (data:), a MIME type
indicating the type of data, an optional base64 token if non-textual,
and the data itself:
data:<mediatype>,<data>
repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
String |
The dataUrls at the given index.
|
getDataUrlsBytes(int index)
public ByteString getDataUrlsBytes(int index)
Output only. Image Data URLs if the current chunk contains images.
Data URLs are composed of four parts: a prefix (data:), a MIME type
indicating the type of data, an optional base64 token if non-textual,
and the data itself:
data:<mediatype>,<data>
repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter |
Name |
Description |
index |
int
The index of the value to return.
|
Returns |
Type |
Description |
ByteString |
The bytes of the dataUrls at the given index.
|
getDataUrlsCount()
public int getDataUrlsCount()
Output only. Image Data URLs if the current chunk contains images.
Data URLs are composed of four parts: a prefix (data:), a MIME type
indicating the type of data, an optional base64 token if non-textual,
and the data itself:
data:<mediatype>,<data>
repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns |
Type |
Description |
int |
The count of dataUrls.
|
getDataUrlsList()
public ProtocolStringList getDataUrlsList()
Output only. Image Data URLs if the current chunk contains images.
Data URLs are composed of four parts: a prefix (data:), a MIME type
indicating the type of data, an optional base64 token if non-textual,
and the data itself:
data:<mediatype>,<data>
repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
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];
public Chunk.DocumentMetadata getDocumentMetadata()
Metadata of the document from the current chunk.
.google.cloud.discoveryengine.v1.Chunk.DocumentMetadata document_metadata = 5;
public Chunk.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder()
Metadata of the document from the current chunk.
.google.cloud.discoveryengine.v1.Chunk.DocumentMetadata document_metadata = 5;
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()
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.v1.Chunk.PageSpan page_span = 6;
getPageSpanOrBuilder()
public Chunk.PageSpanOrBuilder getPageSpanOrBuilder()
Page span of the chunk.
.google.cloud.discoveryengine.v1.Chunk.PageSpan page_span = 6;
getParserForType()
public Parser<Chunk> getParserForType()
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
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
public boolean hasChunkMetadata()
Output only. Metadata of the current chunk.
.google.cloud.discoveryengine.v1.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.
|
public boolean hasDocumentMetadata()
Metadata of the document from the current chunk.
.google.cloud.discoveryengine.v1.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.v1.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
SearchResponse.
optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns |
Type |
Description |
boolean |
Whether the relevanceScore field is set.
|
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Chunk.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Chunk.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public Chunk.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides