View Source Qdrant.Api.Http.Collections (Qdrant v0.0.1)

Qdrant API Collections.

Collections are searchable collections of points.

Link to this section Summary

Functions

Get detailed information about specified existing collection

Create new collection with given parameters.

Get list name of all existing collections.

Link to this section Functions

Link to this function

collection_info(collection_name)

View Source
@spec collection_info(String.t()) :: {:ok, map()} | {:error, any()}

Get detailed information about specified existing collection

path-parameters

Path parameters

  • collection_name (required) : name of the collection

example

Example

iex> Qdrant.Api.Http.Collections.collection_info("my_collection")
{:ok, %Tesla.Env{status: 200,
  body: %{
      "result" => %{
        "collection_type" => "Flat",
        "name" => "my_collection",
        "points_count" => 0,
        "vectors_count" => 0
      },
      "status" => "ok",
      "time" => 2.043e-6
    }
  }
}
Link to this function

create_collection(name, body)

View Source
@spec create_collection(String.t(), String.t()) :: {:ok, map()} | {:error, any()}

Create new collection with given parameters.

path-parameters

Path parameters

  • name (required) : Name of the new collection

query-parameters

Query parameters

  • timeout (optional) : Wait for operation commit timeout in seconds. If timeout is reached - request will return with service error.

request-body-schema

Request body schema

  • vectors (required): Vector params separator for single and multiple vector modes. Single mode: %{size: 128, distance: "Cosine"} or multiple mode: %{default: {size: 128, distance: "Cosine"}}

  • shard_number (optional): null or positive integer Default: null. Number of shards in collection. Default is 1 for standalone, otherwise equal to the number of nodes Minimum is 1.

  • replication_factor (optional): null or positive integer Default: null. Number of shards replicas. Default is 1 Minimum is 1

  • write_consistency_factor (optional): null or positive integer Default: null. Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.

  • on_disk_payload (optional): boolean or null Default: null. If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.

Link to this function

create_collection(name, body, timeout)

View Source
@spec list_collections() :: {:ok, Tesla.Env.t()} | {:error, any()}

Get list name of all existing collections.

example

Example

iex> Qdrant.Api.Http.Collections.list_collections()
{:ok, %Tesla.Env{status: 200,
  body: %{
      "result" => %{"collections" => [...]},
      "status" => "ok",
      "time" => 2.043e-6
    }
  }
}