Qdrant API Collections.
Collections are searchable collections of points.
Summary
Functions
Check if collection exists.
Create new collection with given parameters.
Drop collection and all associated data.
Get detailed information about specified existing collection.
Retrieves parameters from the specified collection.
Get list name of all existing collections.
Update parameters of the existing collection.
Functions
@spec collection_exists(String.t()) :: Qdrant.Types.result(map())
@spec collection_exists(Qdrant.Client.t(), String.t(), Qdrant.Types.request_options()) :: Qdrant.Types.result(map())
Check if collection exists.
Parameters
collection_name- Name of the collection to check
Network example (not a doctest)
client = Qdrant.Client.new!()
Qdrant.Api.Http.Collections.collection_exists(client, "my_collection")
{:ok, %{"result" => %{"exists" => true}}}
@spec create_collection(String.t(), Qdrant.Types.request_body()) :: Qdrant.Types.result(map())
@spec create_collection(Qdrant.Client.t(), String.t(), Qdrant.Types.request_body()) :: Qdrant.Types.result(map())
@spec create_collection(String.t(), Qdrant.Types.request_body(), integer() | nil) :: Qdrant.Types.result(map())
@spec create_collection( Qdrant.Client.t(), String.t(), Qdrant.Types.request_body(), Qdrant.Types.request_options() ) :: Qdrant.Types.result(map())
Create new collection with given parameters.
Parameters
collection_name- Name of the new collectionbody- Collection configuration parameters (must includevectorskey)opts- Options, including:timeoutin seconds for operation commit
Network example (not a doctest)
client = Qdrant.Client.new!()
body = %{vectors: %{size: 128, distance: "Cosine"}}
Qdrant.Api.Http.Collections.create_collection(client, "my_collection", body)
{:ok, %{"result" => true, "status" => "ok"}}
@spec delete_collection(String.t()) :: Qdrant.Types.result(map())
@spec delete_collection(Qdrant.Client.t(), String.t()) :: Qdrant.Types.result(map())
@spec delete_collection(String.t(), integer() | nil) :: Qdrant.Types.result(map())
@spec delete_collection(Qdrant.Client.t(), String.t(), Qdrant.Types.request_options()) :: Qdrant.Types.result(map())
Drop collection and all associated data.
Parameters
collection_name- Name of the collection to deleteopts- Options, including:timeoutin seconds for operation commit
Network example (not a doctest)
client = Qdrant.Client.new!()
Qdrant.Api.Http.Collections.delete_collection(client, "my_collection")
{:ok, %{"result" => true, "status" => "ok"}}
@spec get_collection(String.t()) :: Qdrant.Types.result(map())
@spec get_collection(Qdrant.Client.t(), String.t(), Qdrant.Types.request_options()) :: Qdrant.Types.result(map())
Get detailed information about specified existing collection.
Parameters
collection_name- The name of the collection to retrieve information from.
Network example (not a doctest)
client = Qdrant.Client.new!()
Qdrant.Api.Http.Collections.get_collection(client, "my_collection")
{:ok, %{"result" => %{"name" => "my_collection", ...}}}
@spec get_collection_details(String.t()) :: Qdrant.Types.result(map())
@spec get_collection_details( Qdrant.Client.t(), String.t(), Qdrant.Types.request_options() ) :: Qdrant.Types.result(map())
Retrieves parameters from the specified collection.
Alias for get_collection/1 for backward compatibility.
Parameters
collection_name- The name of the collection to retrieve parameters from.
Network example (not a doctest)
client = Qdrant.Client.new!()
Qdrant.Api.Http.Collections.get_collection_details(client, "my_collection")
{:ok, %{"result" => %{"name" => "my_collection", ...}}}
@spec list_collections() :: Qdrant.Types.result(map())
@spec list_collections(Qdrant.Client.t(), Qdrant.Types.request_options()) :: Qdrant.Types.result(map())
Get list name of all existing collections.
Network example (not a doctest)
client = Qdrant.Client.new!()
Qdrant.Api.Http.Collections.list_collections(client)
{:ok, %{"result" => %{"collections" => [...]}}}
@spec update_collection(String.t(), Qdrant.Types.request_body()) :: Qdrant.Types.result(map())
@spec update_collection(Qdrant.Client.t(), String.t(), Qdrant.Types.request_body()) :: Qdrant.Types.result(map())
@spec update_collection(String.t(), Qdrant.Types.request_body(), integer() | nil) :: Qdrant.Types.result(map())
@spec update_collection( Qdrant.Client.t(), String.t(), Qdrant.Types.request_body(), Qdrant.Types.request_options() ) :: Qdrant.Types.result(map())
Update parameters of the existing collection.
Parameters
collection_name- Name of the collection to updatebody- New collection parametersopts- Options, including:timeoutin seconds for operation commit
Network example (not a doctest)
client = Qdrant.Client.new!()
body = %{optimizers_config: %{deleted_threshold: 0.2}}
Qdrant.Api.Http.Collections.update_collection(client, "my_collection", body)
{:ok, %{"result" => true, "status" => "ok"}}