Qdrant.Types (Qdrant v0.1.15)

Copy Markdown View Source

Canonical shared types for Qdrant request and response values.

Large request schemas evolve with Qdrant and are intentionally represented by map() in endpoint APIs rather than by incomplete closed maps.

Summary

Types

batch_request()

@type batch_request() :: %{searches: [request_body()]}

consistency()

@type consistency() :: non_neg_integer() | :majority | :quorum | :all

dense_vector()

@type dense_vector() :: [number()]

extended_point_id()

@type extended_point_id() :: non_neg_integer() | String.t()

health_body()

@type health_body() :: json_value()

hnsw_config()

@type hnsw_config() :: %{
  optional(:m) => non_neg_integer(),
  optional(:ef_construct) => non_neg_integer(),
  optional(:full_scan_threshold) => non_neg_integer(),
  optional(:max_indexing_threads) => non_neg_integer(),
  optional(:on_disk) => boolean(),
  optional(:payload_m) => non_neg_integer()
}

json_value()

@type json_value() :: String.t() | map() | list() | boolean() | number() | nil

match()

@type match() :: %{
  optional(:value) => match_value(),
  optional(:text) => String.t(),
  optional(:any) => [match_value()],
  optional(:except) => [match_value()]
}

match_any()

@type match_any() :: %{any: [match_value()]}

match_except()

@type match_except() :: %{except: [match_value()]}

match_value()

@type match_value() :: String.t() | number() | boolean()

multivector()

@type multivector() :: [dense_vector()]

named_vector()

@type named_vector() :: %{name: String.t(), vector: unnamed_vector()}

optimizers_config()

@type optimizers_config() :: %{
  optional(:deleted_threshold) => number(),
  optional(:vacuum_min_vector_number) => non_neg_integer(),
  optional(:default_segment_number) => non_neg_integer(),
  optional(:max_segment_size) => non_neg_integer(),
  optional(:memmap_threshold) => non_neg_integer(),
  optional(:indexing_threshold) => non_neg_integer(),
  optional(:flush_interval_sec) => non_neg_integer(),
  optional(:max_optimization_threads) => pos_integer()
}

ordering()

@type ordering() :: :weak | :medium | :strong

payload_selector()

@type payload_selector() :: %{include: [String.t()]} | %{exclude: [String.t()]}

point()

@type point() :: %{
  :id => extended_point_id(),
  optional(:vector) => vector(),
  optional(:payload) => map()
}

point_id_list()

@type point_id_list() :: point_ids()

point_ids()

@type point_ids() :: [extended_point_id()]

quantization_config()

@type quantization_config() :: map()

request_body()

@type request_body() :: map()

request_option()

@type request_option() ::
  {:query, keyword() | map()}
  | {:body, term()}
  | {:response, :auto | :json | :text | :binary}

request_options()

@type request_options() :: keyword()

result()

@type result() :: result(term())

result(response)

@type result(response) :: {:ok, response} | {:error, Qdrant.Error.t()}

score_threshold()

@type score_threshold() :: number()

sparse_vector()

@type sparse_vector() :: %{indices: [non_neg_integer()], values: [number()]}

unnamed_vector()

@type unnamed_vector() :: dense_vector() | sparse_vector() | multivector()

vector()

@type vector() :: unnamed_vector() | named_vector()

with_payload_interface()

@type with_payload_interface() :: boolean() | [String.t()] | payload_selector()