Reference documentation and code samples for the Vector Search V1 API class Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.
REST client for the DataObjectSearchService service.
Service for searching data objects.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the DataObjectSearchService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all DataObjectSearchService clients ::Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.configure do |config| config.timeout = 10.0 end
#aggregate_data_objects
def aggregate_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponse
def aggregate_data_objects(parent: nil, filter: nil, aggregate: nil) -> ::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponseAggregates data objects.
def aggregate_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponseaggregate_data_objects via a request object, either of type
AggregateDataObjectsRequest or an equivalent Hash.
- request (::Google::Cloud::VectorSearch::V1::AggregateDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def aggregate_data_objects(parent: nil, filter: nil, aggregate: nil) -> ::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponseaggregate_data_objects via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the Collection for which to query.
Format:
projects/{project}/locations/{location}/collections/{collection} - filter (::Google::Protobuf::Struct, ::Hash) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.
- aggregate (::Google::Cloud::VectorSearch::V1::AggregationMethod) — Required. The aggregation method to apply to the query.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/vector_search/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::VectorSearch::V1::AggregateDataObjectsRequest.new # Call the aggregate_data_objects method. result = client.aggregate_data_objects request # The returned object is of type Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponse. p result
#batch_search_data_objects
def batch_search_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponse
def batch_search_data_objects(parent: nil, searches: nil, combine: nil) -> ::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponseBatch searches data objects.
def batch_search_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponsebatch_search_data_objects via a request object, either of type
BatchSearchDataObjectsRequest or an equivalent Hash.
- request (::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def batch_search_data_objects(parent: nil, searches: nil, combine: nil) -> ::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponsebatch_search_data_objects via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the Collection for which to search.
Format:
projects/{project}/locations/{location}/collections/{collection} - searches (::Array<::Google::Cloud::VectorSearch::V1::Search, ::Hash>) — Required. A list of search requests to execute in parallel.
- combine (::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsRequest::CombineResultsOptions, ::Hash) — Optional. Options for combining the results of the batch search operations.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/vector_search/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsRequest.new # Call the batch_search_data_objects method. result = client.batch_search_data_objects request # The returned object is of type Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponse. p result
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the DataObjectSearchService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> ClientCreate a new DataObjectSearchService REST client object.
- (config) — Configure the DataObjectSearchService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#query_data_objects
def query_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>
def query_data_objects(parent: nil, filter: nil, output_fields: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>Queries data objects.
def query_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>query_data_objects via a request object, either of type
QueryDataObjectsRequest or an equivalent Hash.
- request (::Google::Cloud::VectorSearch::V1::QueryDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def query_data_objects(parent: nil, filter: nil, output_fields: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>query_data_objects via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the Collection for which to query.
Format:
projects/{project}/locations/{location}/collections/{collection} - filter (::Google::Protobuf::Struct, ::Hash) — Optional. A JSON filter expression, e.g. {"genre": \{"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.
- output_fields (::Google::Cloud::VectorSearch::V1::OutputFields, ::Hash) — Optional. Mask specifying which fields to return.
- page_size (::Integer) — Optional. The standard list page size. Default is 100. The maximum value is 1000; values above 1000 will be coerced to 1000.
- page_token (::String) — Optional. The standard list page token. Typically obtained via QueryDataObjectsResponse.next_page_token of the previous DataObjectSearchService.QueryDataObjects call.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/vector_search/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::VectorSearch::V1::QueryDataObjectsRequest.new # Call the query_data_objects method. result = client.query_data_objects request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::VectorSearch::V1::DataObject. p item end
#search_data_objects
def search_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>
def search_data_objects(vector_search: nil, semantic_search: nil, text_search: nil, parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>Searches data objects.
def search_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>search_data_objects via a request object, either of type
SearchDataObjectsRequest or an equivalent Hash.
- request (::Google::Cloud::VectorSearch::V1::SearchDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def search_data_objects(vector_search: nil, semantic_search: nil, text_search: nil, parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>search_data_objects via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
vector_search (::Google::Cloud::VectorSearch::V1::VectorSearch, ::Hash) — A vector search operation.
Note: The following parameters are mutually exclusive:
vector_search,semantic_search,text_search. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. -
semantic_search (::Google::Cloud::VectorSearch::V1::SemanticSearch, ::Hash) — A semantic search operation.
Note: The following parameters are mutually exclusive:
semantic_search,vector_search,text_search. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. -
text_search (::Google::Cloud::VectorSearch::V1::TextSearch, ::Hash) — Optional. A text search operation.
Note: The following parameters are mutually exclusive:
text_search,vector_search,semantic_search. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. -
parent (::String) — Required. The resource name of the Collection for which to search.
Format:
projects/{project}/locations/{location}/collections/{collection} - page_size (::Integer) — Optional. The standard list page size. Only supported for KNN. If not set, up to search_type.top_k results will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
- page_token (::String) — Optional. The standard list page token. Typically obtained via SearchDataObjectsResponse.next_page_token of the previous DataObjectSearchService.SearchDataObjects call.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/vector_search/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VectorSearch::V1::DataObjectSearchService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::VectorSearch::V1::SearchDataObjectsRequest.new # Call the search_data_objects method. result = client.search_data_objects request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::VectorSearch::V1::SearchResult. p item end
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)