# Vision AI V1 API - Class Google::Cloud::VisionAI::V1::SearchResultItem (v1.5.0)

1.5.0 (latest) 1.4.1 1.3.1 1.2.0 1.1.1 1.0.1 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Vision AI V1 API class Google::Cloud::VisionAI::V1::SearchResultItem.

Search result contains asset name and corresponding time ranges.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #annotation_matching_results

    def annotation_matching_results() -> ::Array<::Google::Cloud::VisionAI::V1::AnnotationMatchingResult>

**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::AnnotationMatchingResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-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.

### #annotation_matching_results=

    def annotation_matching_results=(value) -> ::Array<::Google::Cloud::VisionAI::V1::AnnotationMatchingResult>

**Parameter**

- **value** (::Array\<[::Google::Cloud::VisionAI::V1::AnnotationMatchingResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-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.
**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::AnnotationMatchingResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-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.

### #asset

    def asset() -> ::String

**Returns**

- (::String) --- The resource name of the asset. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`

### #asset=

    def asset=(value) -> ::String

**Parameter**

- **value** (::String) --- The resource name of the asset. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
**Returns**

- (::String) --- The resource name of the asset. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`

### #relevance

    def relevance() -> ::Float

**Returns**

- (::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.

### #relevance=

    def relevance=(value) -> ::Float

**Parameter**

- **value** (::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.
**Returns**

- (::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

    def requested_annotations() -> ::Array<::Google::Cloud::VisionAI::V1::Annotation>

**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::Annotation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Annotation)\>) --- Search result annotations specified by result_annotation_keys in search request.

### #requested_annotations=

    def requested_annotations=(value) -> ::Array<::Google::Cloud::VisionAI::V1::Annotation>

**Parameter**

- **value** (::Array\<[::Google::Cloud::VisionAI::V1::Annotation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Annotation)\>) --- Search result annotations specified by result_annotation_keys in search request.
**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::Annotation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Annotation)\>) --- Search result annotations specified by result_annotation_keys in search request.

### #segment

    def segment() -> ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition

**Returns**

- ([::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)) --- The matched asset segment.

### #segment=

    def segment=(value) -> ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition

**Parameter**

- **value** ([::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)) --- The matched asset segment.
**Returns**

- ([::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)) --- The matched asset segment.

### #segments

    def segments() -> ::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>

**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)\>) --- The matched asset segments. Deprecated: please use singular `segment` field.

### #segments=

    def segments=(value) -> ::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>

**Parameter**

- **value** (::Array\<[::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)\>) --- The matched asset segments. Deprecated: please use singular `segment` field.
**Returns**

- (::Array\<[::Google::Cloud::VisionAI::V1::Partition::TemporalPartition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest/Google-Cloud-VisionAI-V1-Partition-TemporalPartition)\>) --- The matched asset segments. Deprecated: please use singular `segment` field.