# `Qdrant.Api.Http.Collections`
[🔗](https://github.com/marinac-dev/qdrant/blob/v0.1.18/lib/qdrant/api/http/collections.ex#L1)

Qdrant API Collections.

Collections are searchable collections of points.

# `collection_exists`

```elixir
@spec collection_exists(String.t()) :: Qdrant.Types.result(map())
```

# `collection_exists`

```elixir
@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}}}

# `create_collection`

```elixir
@spec create_collection(String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result(map())
```

# `create_collection`

```elixir
@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())
```

# `create_collection`

```elixir
@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 collection
* `body` - Collection configuration parameters (must include `vectors` key)
* `opts` - Options, including `:timeout` in 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"}}

# `create_vector_name`

```elixir
@spec create_vector_name(String.t(), String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result(map())
```

# `create_vector_name`

```elixir
@spec create_vector_name(
  Qdrant.Client.t(),
  String.t(),
  String.t(),
  Qdrant.Types.request_body()
) ::
  Qdrant.Types.result(map())
@spec create_vector_name(
  String.t(),
  String.t(),
  Qdrant.Types.request_body(),
  boolean() | nil
) ::
  Qdrant.Types.result(map())
```

# `create_vector_name`

```elixir
@spec create_vector_name(
  Qdrant.Client.t(),
  String.t(),
  String.t(),
  Qdrant.Types.request_body(),
  Qdrant.Types.request_options()
) :: Qdrant.Types.result(map())
@spec create_vector_name(
  String.t(),
  String.t(),
  Qdrant.Types.request_body(),
  boolean() | nil,
  Qdrant.Types.ordering() | nil
) :: Qdrant.Types.result(map())
```

Creates a named vector on an existing collection.

The body contains either a dense vector configuration, such as
`%{dense: %{size: 768, distance: "Cosine"}}`, or a sparse configuration.
Options are `:wait`, `:ordering`, and `:timeout`.

# `create_vector_name`

```elixir
@spec create_vector_name(
  String.t(),
  String.t(),
  Qdrant.Types.request_body(),
  boolean() | nil,
  Qdrant.Types.ordering() | nil,
  integer() | nil
) :: Qdrant.Types.result(map())
```

# `delete_collection`

```elixir
@spec delete_collection(String.t()) :: Qdrant.Types.result(map())
```

# `delete_collection`

```elixir
@spec delete_collection(Qdrant.Client.t(), String.t()) :: Qdrant.Types.result(map())
@spec delete_collection(String.t(), integer() | nil) :: Qdrant.Types.result(map())
```

# `delete_collection`

```elixir
@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 delete
* `opts` - Options, including `:timeout` in 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"}}

# `delete_vector_name`

```elixir
@spec delete_vector_name(String.t(), String.t()) :: Qdrant.Types.result(map())
```

# `delete_vector_name`

```elixir
@spec delete_vector_name(Qdrant.Client.t(), String.t(), String.t()) ::
  Qdrant.Types.result(map())
@spec delete_vector_name(String.t(), String.t(), boolean() | nil) ::
  Qdrant.Types.result(map())
```

# `delete_vector_name`

```elixir
@spec delete_vector_name(
  Qdrant.Client.t(),
  String.t(),
  String.t(),
  Qdrant.Types.request_options()
) ::
  Qdrant.Types.result(map())
@spec delete_vector_name(
  String.t(),
  String.t(),
  boolean() | nil,
  Qdrant.Types.ordering() | nil
) ::
  Qdrant.Types.result(map())
```

Deletes a named vector from an existing collection.

# `delete_vector_name`

```elixir
@spec delete_vector_name(
  String.t(),
  String.t(),
  boolean() | nil,
  Qdrant.Types.ordering() | nil,
  integer() | nil
) :: Qdrant.Types.result(map())
```

# `get_collection`

```elixir
@spec get_collection(String.t()) :: Qdrant.Types.result(map())
```

# `get_collection`

```elixir
@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", ...}}}

# `get_collection_details`

```elixir
@spec get_collection_details(String.t()) :: Qdrant.Types.result(map())
```

# `get_collection_details`

```elixir
@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", ...}}}

# `get_optimizations`

```elixir
@spec get_optimizations(String.t()) :: Qdrant.Types.result(map())
```

# `get_optimizations`

```elixir
@spec get_optimizations(Qdrant.Client.t(), String.t()) :: Qdrant.Types.result(map())
@spec get_optimizations(String.t(), Qdrant.Types.request_options()) ::
  Qdrant.Types.result(map())
```

# `get_optimizations`

```elixir
@spec get_optimizations(Qdrant.Client.t(), String.t(), Qdrant.Types.request_options()) ::
  Qdrant.Types.result(map())
```

Returns optimization progress for a collection.

`:with` accepts a comma-separated string or a list containing `:queued`,
`:completed`, and `:idle_segments`. `:completed_limit` limits completed
optimizations returned by Qdrant.

# `list_collections`

```elixir
@spec list_collections() :: Qdrant.Types.result(map())
```

# `list_collections`

```elixir
@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" => [...]}}}

# `update_collection`

```elixir
@spec update_collection(String.t(), Qdrant.Types.request_body()) ::
  Qdrant.Types.result(map())
```

# `update_collection`

```elixir
@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())
```

# `update_collection`

```elixir
@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 update
* `body` - New collection parameters
* `opts` - Options, including `:timeout` in 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"}}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
