# Google Cloud Vision Ai V1 Client - Class SearchResultItem (0.3.0)

0.3.0 (latest) 0.2.0 0.1.0 Reference documentation and code samples for the Google Cloud Vision Ai V1 Client class SearchResultItem.

Search result contains asset name and corresponding time ranges.

Generated from protobuf message `google.cloud.visionai.v1.SearchResultItem`

## Namespace

Google \\ Cloud \\ VisionAI \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ asset` | `string` The resource name of the asset. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` |
| `↳ segments` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition>` The matched asset segments. Deprecated: please use singular `segment` field. |
| `↳ segment` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition` The matched asset segment. |
| `↳ relevance` | `float` Available to IMAGE corpus types. Relevance of this `SearchResultItem` to user search query (text query or image query). By default this represents cosine similarity between the query and the retrieved media content. The value is in the range of \[-1, 1\]. Note that search ranking is not only decided by this relevance score, but also other factors such as the match of annotations. |
| `↳ requested_annotations` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Annotation>` Search result annotations specified by result_annotation_keys in search request. |
| `↳ annotation_matching_results` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.AnnotationMatchingResult>` Criteria or facet-selection based annotation matching results associated to this search result item. Only contains results for criteria or facet_selections with fetch_matched_annotations=true. |

### getAsset

The resource name of the asset.

Format:
`projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setAsset

The resource name of the asset.

Format:
`projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSegments

The matched asset segments.

Deprecated: please use singular `segment` field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition>` |   |

### setSegments

The matched asset segments.

Deprecated: please use singular `segment` field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSegment

The matched asset segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition|null` |   |

### hasSegment

### clearSegment

### setSegment

The matched asset segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Partition.TemporalPartition` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRelevance

Available to IMAGE corpus types.

Relevance of this `SearchResultItem` to user search query (text query or
image query).
By default this represents cosine similarity between the query and the
retrieved media content. The value is in the range of \[-1, 1\].
Note that search ranking is not only decided by this relevance score, but
also other factors such as the match of annotations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setRelevance

Available to IMAGE corpus types.

Relevance of this `SearchResultItem` to user search query (text query or
image query).
By default this represents cosine similarity between the query and the
retrieved media content. The value is in the range of \[-1, 1\].
Note that search ranking is not only decided by this relevance score, but
also other factors such as the match of annotations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRequestedAnnotations

Search result annotations specified by result_annotation_keys in search
request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Annotation>` |   |

### setRequestedAnnotations

Search result annotations specified by result_annotation_keys in search
request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Annotation>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAnnotationMatchingResults

Criteria or facet-selection based annotation matching results associated to
this search result item. Only contains results for criteria or
facet_selections with fetch_matched_annotations=true.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.AnnotationMatchingResult>` |   |

### setAnnotationMatchingResults

Criteria or facet-selection based annotation matching results associated to
this search result item. Only contains results for criteria or
facet_selections with fetch_matched_annotations=true.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.AnnotationMatchingResult>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |