Vector Search V1 API - Class Google::Cloud::VectorSearch::V1::VectorSearch (v0.1.0)

Reference documentation and code samples for the Vector Search V1 API class Google::Cloud::VectorSearch::V1::VectorSearch.

Defines a search operation using a query vector.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#distance_metric

def distance_metric() -> ::Google::Cloud::VectorSearch::V1::DistanceMetric
Returns

#distance_metric=

def distance_metric=(value) -> ::Google::Cloud::VectorSearch::V1::DistanceMetric
Parameter
Returns

#filter

def filter() -> ::Google::Protobuf::Struct
Returns
  • (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.

#filter=

def filter=(value) -> ::Google::Protobuf::Struct
Parameter
  • value (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.
Returns
  • (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.

#output_fields

def output_fields() -> ::Google::Cloud::VectorSearch::V1::OutputFields
Returns

#output_fields=

def output_fields=(value) -> ::Google::Cloud::VectorSearch::V1::OutputFields
Parameter
Returns

#search_field

def search_field() -> ::String
Returns
  • (::String) — Required. The vector field to search.

#search_field=

def search_field=(value) -> ::String
Parameter
  • value (::String) — Required. The vector field to search.
Returns
  • (::String) — Required. The vector field to search.

#search_hint

def search_hint() -> ::Google::Cloud::VectorSearch::V1::SearchHint
Returns

#search_hint=

def search_hint=(value) -> ::Google::Cloud::VectorSearch::V1::SearchHint
Parameter
Returns

#sparse_vector

def sparse_vector() -> ::Google::Cloud::VectorSearch::V1::SparseVector
Returns
  • (::Google::Cloud::VectorSearch::V1::SparseVector) — A sparse vector for the query.

    Note: The following fields are mutually exclusive: sparse_vector, vector. If a field in that set is populated, all other fields in the set will automatically be cleared.

#sparse_vector=

def sparse_vector=(value) -> ::Google::Cloud::VectorSearch::V1::SparseVector
Parameter
  • value (::Google::Cloud::VectorSearch::V1::SparseVector) — A sparse vector for the query.

    Note: The following fields are mutually exclusive: sparse_vector, vector. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::VectorSearch::V1::SparseVector) — A sparse vector for the query.

    Note: The following fields are mutually exclusive: sparse_vector, vector. If a field in that set is populated, all other fields in the set will automatically be cleared.

#top_k

def top_k() -> ::Integer
Returns
  • (::Integer) — Optional. The number of nearest neighbors to return.

#top_k=

def top_k=(value) -> ::Integer
Parameter
  • value (::Integer) — Optional. The number of nearest neighbors to return.
Returns
  • (::Integer) — Optional. The number of nearest neighbors to return.

#vector

def vector() -> ::Google::Cloud::VectorSearch::V1::DenseVector
Returns
  • (::Google::Cloud::VectorSearch::V1::DenseVector) — A dense vector for the query.

    Note: The following fields are mutually exclusive: vector, sparse_vector. If a field in that set is populated, all other fields in the set will automatically be cleared.

#vector=

def vector=(value) -> ::Google::Cloud::VectorSearch::V1::DenseVector
Parameter
  • value (::Google::Cloud::VectorSearch::V1::DenseVector) — A dense vector for the query.

    Note: The following fields are mutually exclusive: vector, sparse_vector. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::VectorSearch::V1::DenseVector) — A dense vector for the query.

    Note: The following fields are mutually exclusive: vector, sparse_vector. If a field in that set is populated, all other fields in the set will automatically be cleared.