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

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

Configure the DataObjectSearchService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# 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::AggregateDataObjectsResponse

Aggregates data objects.

Overloads
def aggregate_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::AggregateDataObjectsResponse
Pass arguments to aggregate_data_objects via a request object, either of type AggregateDataObjectsRequest or an equivalent Hash.
Parameters
  • 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::AggregateDataObjectsResponse
Pass arguments to aggregate_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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

Batch searches data objects.

Overloads
def batch_search_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchSearchDataObjectsResponse
Pass arguments to batch_search_data_objects via a request object, either of type BatchSearchDataObjectsRequest or an equivalent Hash.
Parameters
  • 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::BatchSearchDataObjectsResponse
Pass arguments to batch_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).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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

Configure 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new DataObjectSearchService REST client object.

Yields
  • (config) — Configure the DataObjectSearchService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# 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::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (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.

Overloads
def query_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::DataObject>
Pass arguments to query_data_objects via a request object, either of type QueryDataObjectsRequest or an equivalent Hash.
Parameters
  • 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>
Pass arguments to 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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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.

Overloads
def search_data_objects(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::SearchResult>
Pass arguments to search_data_objects via a request object, either of type SearchDataObjectsRequest or an equivalent Hash.
Parameters
  • 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>
Pass arguments to 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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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() -> String

The effective universe domain

Returns
  • (String)