- [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#SCHEMA_REPRESENTATION)
- [Chunk](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk.SCHEMA_REPRESENTATION)
- [DocumentMetadata](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DocumentMetadata)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DocumentMetadata.SCHEMA_REPRESENTATION)
- [PageSpan](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#PageSpan)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#PageSpan.SCHEMA_REPRESENTATION)
- [ChunkMetadata](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#ChunkMetadata)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#ChunkMetadata.SCHEMA_REPRESENTATION)
- [AnnotationMetadata](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#AnnotationMetadata)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#AnnotationMetadata.SCHEMA_REPRESENTATION)
- [StructuredContent](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructuredContent)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructuredContent.SCHEMA_REPRESENTATION)
- [StructureType](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructureType)
- [DoubleList](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DoubleList)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DoubleList.SCHEMA_REPRESENTATION)
- [RankSignals](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RankSignals)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RankSignals.SCHEMA_REPRESENTATION)
- [CustomSignal](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#CustomSignal)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#CustomSignal.SCHEMA_REPRESENTATION)
- [RetrievalSignals](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSignals)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSignals.SCHEMA_REPRESENTATION)
- [RetrievalSource](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSource)

Represents the search results.

| JSON representation |
|---|
| ``` { "id": string, "document": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.branches.documents#Document`) }, "chunk": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`) }, "modelScores": { string: { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DoubleList`) }, ... }, "rankSignals": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RankSignals`) }, "retrievalSignals": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSignals`) } } ``` |

| Fields ||
|---|---|
| `id` | `string` `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.branches.documents#Document.FIELDS.id` of the searched `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.branches.documents#Document`. |
| `document` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.branches.documents#Document`)`` The document data snippet in the search response. Only fields that are marked as `retrievable` are populated. |
| `chunk` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`)`` The chunk data in the search response if the `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/ContentSearchSpec#FIELDS.search_result_mode` is set to `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/ContentSearchSpec#SearchResultMode.ENUM_VALUES.CHUNKS`. |
| `modelScores` | ``map (key: string, value: object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DoubleList`))`` Output only. Google provided available scores. |
| `rankSignals` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RankSignals`)`` Optional. A set of ranking signals associated with the result. |
| `retrievalSignals` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSignals`)`` Optional. A set of signals used by the relevance filter meant for use to fine-tune the relevance filter thresholds. |

## Chunk

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

| JSON representation |
|---|
| ``` { "name": string, "id": string, "content": string, "documentMetadata": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DocumentMetadata`) }, "derivedStructData": { object }, "pageSpan": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#PageSpan`) }, "chunkMetadata": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#ChunkMetadata`) }, "dataUrls": [ string ], "annotationContents": [ string ], "annotationMetadata": [ { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#AnnotationMetadata`) } ], "relevanceScore": number } ``` |

| Fields ||
|---|---|
| `name` | `string` The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. |
| `id` | `string` Unique chunk ID of the current chunk. |
| `content` | `string` Content is a string from a document (parsed content). |
| `documentMetadata` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#DocumentMetadata`)`` Metadata of the document from the current chunk. |
| `derivedStructData` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. |
| `pageSpan` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#PageSpan`)`` Page span of the chunk. |
| `chunkMetadata` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#ChunkMetadata`)`` Output only. Metadata of the current chunk. |
| `dataUrls[]` | `string` 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:\[\]\[;base64\], |
| `annotationContents[]` | `string` Output only. Annotation contents if the current chunk contains annotations. |
| `annotationMetadata[]` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#AnnotationMetadata`)`` Output only. The annotation metadata includes structured content in the current chunk. |
| `relevanceScore` | `number` 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 `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResponse`. |

## DocumentMetadata

Document metadata contains the information of the document of the current chunk.

| JSON representation |
|---|
| ``` { "uri": string, "title": string, "mimeType": string, "structData": { object } } ``` |

| Fields ||
|---|---|
| `uri` | `string` Uri of the document. |
| `title` | `string` Title of the document. |
| `mimeType` | `string` The mime type of the document. <https://www.iana.org/assignments/media-types/media-types.xhtml>. |
| `structData` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Data representation. The structured JSON data for the document. It should conform to the registered `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.schemas#Schema` or an `INVALID_ARGUMENT` error is thrown. |

## PageSpan

Page span of the chunk.

| JSON representation |
|---|
| ``` { "pageStart": integer, "pageEnd": integer } ``` |

| Fields ||
|---|---|
| `pageStart` | `integer` The start page of the chunk. |
| `pageEnd` | `integer` The end page of the chunk. |

## ChunkMetadata

Metadata of the current chunk. This field is only populated on `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.servingConfigs/search#google.cloud.discoveryengine.v1.SearchService.Search` API.

| JSON representation |
|---|
| ``` { "previousChunks": [ { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`) } ], "nextChunks": [ { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`) } ] } ``` |

| Fields ||
|---|---|
| `previousChunks[]` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`)`` The previous chunks of the current chunk. The number is controlled by `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/ContentSearchSpec#ChunkSpec.FIELDS.num_previous_chunks`. This field is only populated on `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.servingConfigs/search#google.cloud.discoveryengine.v1.SearchService.Search` API. |
| `nextChunks[]` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#Chunk`)`` The next chunks of the current chunk. The number is controlled by `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/ContentSearchSpec#ChunkSpec.FIELDS.num_next_chunks`. This field is only populated on `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.servingConfigs/search#google.cloud.discoveryengine.v1.SearchService.Search` API. |

## AnnotationMetadata

The annotation metadata includes structured content in the current chunk.

| JSON representation |
|---|
| ``` { "structuredContent": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructuredContent`) }, "imageId": string } ``` |

| Fields ||
|---|---|
| `structuredContent` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructuredContent`)`` Output only. The structured content information. |
| `imageId` | `string` Output only. Image ID is provided if the structured content is based on an image. |

## StructuredContent

The structured content information.

| JSON representation |
|---|
| ``` { "structureType": enum (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructureType`), "content": string } ``` |

| Fields ||
|---|---|
| `structureType` | ``enum (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#StructureType`)`` Output only. The structure type of the structured content. |
| `content` | `string` Output only. The content of the structured content. |

## StructureType

Defines the types of the structured content that can be extracted.

| Enums ||
|---|---|
| `STRUCTURE_TYPE_UNSPECIFIED` | Default value. |
| `SHAREHOLDER_STRUCTURE` | Shareholder structure. |
| `SIGNATURE_STRUCTURE` | signature structure. |
| `CHECKBOX_STRUCTURE` | Checkbox structure. |

## DoubleList

Double list.

| JSON representation |
|---|
| ``` { "values": [ number ] } ``` |

| Fields ||
|---|---|
| `values[]` | `number` Double values. |

## RankSignals

A set of ranking signals.

| JSON representation |
|---|
| ``` { "defaultRank": number, "customSignals": [ { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#CustomSignal`) } ], "precomputedExpressionValues": [ number ], "keywordSimilarityScore": number, "relevanceScore": number, "semanticSimilarityScore": number, "pctrRank": number, "topicalityRank": number, "documentAge": number, "boostingFactor": number } ``` |

| Fields ||
|---|---|
| `defaultRank` | `number` Optional. The default rank of the result. |
| `customSignals[]` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#CustomSignal`)`` Optional. A list of custom clearbox signals. |
| `precomputedExpressionValues[]` | `number` Optional. A list of precomputed expression results for a given document, in the same order as requested in `SearchRequest.custom_ranking_params.expressions_to_precompute`. |
| `keywordSimilarityScore` | `number` Optional. Keyword matching adjustment. |
| `relevanceScore` | `number` Optional. Semantic relevance adjustment. |
| `semanticSimilarityScore` | `number` Optional. Semantic similarity adjustment. |
| `pctrRank` | `number` Optional. Predicted conversion rate adjustment as a rank. |
| `topicalityRank` | `number` Optional. Topicality adjustment as a rank. |
| `documentAge` | `number` Optional. Age of the document in hours. |
| `boostingFactor` | `number` Optional. Combined custom boosts for a doc. |

## CustomSignal

Custom clearbox signal represented by name and value pair.

| JSON representation |
|---|
| ``` { "name": string, "value": number } ``` |

| Fields ||
|---|---|
| `name` | `string` Optional. name of the signal. |
| `value` | `number` Optional. Float value representing the ranking signal (e.g. 1.25 for BM25). |

## RetrievalSignals

Contains a set of signals used by the relevance filter.

| JSON representation |
|---|
| ``` { "retrievalSources": [ enum (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSource`) ], "semanticRelevanceScore": number } ``` |

| Fields ||
|---|---|
| `retrievalSources[]` | ``enum (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SearchResult#RetrievalSource`)`` Optional. Indicates how the result was retrieved. |
| `semanticRelevanceScore` | `number` Optional. Relevance score used by the filter when semanticRelevanceThreshold is set. |

## RetrievalSource

Indicates the source of the retrieval.

| Enums ||
|---|---|
| `RETRIEVAL_SOURCE_UNSPECIFIED` | Unspecified retrieval source. |
| `KEYWORD_SEARCH` | Indicates the result was retrieved by keyword search. |
| `SEMANTIC_SEARCH` | Indicates the result was retrieved by semantic search. |