Class: Milvus::Indexes
Constant Summary collapse
- PATH =
"indexes"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(collection_name:, index_params:) ⇒ Hash
This creates a named index for a target field, which can either be a vector field or a scalar field.
-
#describe(collection_name:, index_name:) ⇒ Hash
This operation describes the current index.
-
#drop(collection_name:, index_name:) ⇒ Hash
This operation deletes index from a specified collection.
-
#list(collection_name:) ⇒ Hash
This operation lists all indexes of a specific collection.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Milvus::Base
Instance Method Details
#create(collection_name:, index_params:) ⇒ Hash
This creates a named index for a target field, which can either be a vector field or a scalar field.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/milvus/indexes.rb', line 12 def create( collection_name:, index_params: ) response = client.connection.post("#{PATH}/create") do |req| req.body = { collectionName: collection_name, indexParams: index_params } end response.body.empty? ? true : response.body end |
#describe(collection_name:, index_name:) ⇒ Hash
This operation describes the current index.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/milvus/indexes.rb', line 48 def describe( collection_name:, index_name: ) response = client.connection.post("#{PATH}/describe") do |req| req.body = { collectionName: collection_name, indexName: index_name } end response.body.empty? ? true : response.body end |
#drop(collection_name:, index_name:) ⇒ Hash
This operation deletes index from a specified collection.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/milvus/indexes.rb', line 30 def drop( collection_name:, index_name: ) response = client.connection.post("#{PATH}/drop") do |req| req.body = { collectionName: collection_name, indexName: index_name } end response.body.empty? ? true : response.body end |
#list(collection_name:) ⇒ Hash
This operation lists all indexes of a specific collection.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/milvus/indexes.rb', line 65 def list( collection_name: ) response = client.connection.post("#{PATH}/list") do |req| req.body = { collectionName: collection_name } end response.body.empty? ? true : response.body end |