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- (::Google::Cloud::VectorSearch::V1::DistanceMetric) — Optional. The distance metric to use for the KNN search. If not specified, DOT_PRODUCT will be used as the default.
#distance_metric=
def distance_metric=(value) -> ::Google::Cloud::VectorSearch::V1::DistanceMetric- value (::Google::Cloud::VectorSearch::V1::DistanceMetric) — Optional. The distance metric to use for the KNN search. If not specified, DOT_PRODUCT will be used as the default.
- (::Google::Cloud::VectorSearch::V1::DistanceMetric) — Optional. The distance metric to use for the KNN search. If not specified, DOT_PRODUCT will be used as the default.
#filter
def filter() -> ::Google::Protobuf::Struct- (::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- value (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.
- (::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- (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. Mask specifying which fields to return.
#output_fields=
def output_fields=(value) -> ::Google::Cloud::VectorSearch::V1::OutputFields- value (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. Mask specifying which fields to return.
- (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. Mask specifying which fields to return.
#search_field
def search_field() -> ::String- (::String) — Required. The vector field to search.
#search_field=
def search_field=(value) -> ::String- value (::String) — Required. The vector field to search.
- (::String) — Required. The vector field to search.
#search_hint
def search_hint() -> ::Google::Cloud::VectorSearch::V1::SearchHint- (::Google::Cloud::VectorSearch::V1::SearchHint) — Optional. Sets the search hint. If no strategy is specified, the service will use an index if one is available, and fall back to the default KNN search otherwise.
#search_hint=
def search_hint=(value) -> ::Google::Cloud::VectorSearch::V1::SearchHint- value (::Google::Cloud::VectorSearch::V1::SearchHint) — Optional. Sets the search hint. If no strategy is specified, the service will use an index if one is available, and fall back to the default KNN search otherwise.
- (::Google::Cloud::VectorSearch::V1::SearchHint) — Optional. Sets the search hint. If no strategy is specified, the service will use an index if one is available, and fall back to the default KNN search otherwise.
#sparse_vector
def sparse_vector() -> ::Google::Cloud::VectorSearch::V1::SparseVector-
(::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-
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.
-
(::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- (::Integer) — Optional. The number of nearest neighbors to return.
#top_k=
def top_k=(value) -> ::Integer- value (::Integer) — Optional. The number of nearest neighbors to return.
- (::Integer) — Optional. The number of nearest neighbors to return.
#vector
def vector() -> ::Google::Cloud::VectorSearch::V1::DenseVector-
(::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-
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.
-
(::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.