Google Cloud Vision Ai V1 Client - Class SearchResultItem (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<Partition\TemporalPartition>

The matched asset segments. Deprecated: please use singular segment field.

↳ segment 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<Annotation>

Search result annotations specified by result_annotation_keys in search request.

↳ annotation_matching_results array<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
Google\Protobuf\Internal\RepeatedField

setSegments

The matched asset segments.

Deprecated: please use singular segment field.

Parameter
Name Description
var array<Partition\TemporalPartition>
Returns
Type Description
$this

getSegment

The matched asset segment.

Returns
Type Description
Partition\TemporalPartition|null

hasSegment

clearSegment

setSegment

The matched asset segment.

Parameter
Name Description
var 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
Google\Protobuf\Internal\RepeatedField

setRequestedAnnotations

Search result annotations specified by result_annotation_keys in search request.

Parameter
Name Description
var array<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
Google\Protobuf\Internal\RepeatedField

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<AnnotationMatchingResult>
Returns
Type Description
$this