Zvex.Collection.Schema.IndexParams (zvex v0.4.1)

Copy Markdown View Source

Index configuration for a schema field.

Used by Zvex.Collection.Schema.add_field/4 when the :index option is provided, and by Zvex.Collection.create_index/3 for runtime index creation.

Fields

FieldApplies toDescription
:typeallRequired. Index algorithm: :hnsw, :ivf, :flat, or :invert.
:metricvectorDistance metric: :l2, :ip, :cosine, or :mipsl2.
:quantizevectorQuantization: :fp16, :int8, or :int4.
:mHNSWMax connections per node (higher = better recall, more memory).
:ef_constructionHNSWBuild-time search width (higher = better index, slower build).
:n_listIVFNumber of inverted-file partitions.
:n_itersIVFK-means training iterations.
:use_soarHNSWEnable SOAR graph optimization.
:enable_range_optinvertEnable range query optimization.
:enable_wildcardinvertEnable wildcard/prefix matching.

Summary

Types

t()

Index configuration struct. See module documentation for field details.

Functions

Builds an IndexParams struct from a keyword list.

Types

t()

@type t() :: %Zvex.Collection.Schema.IndexParams{
  ef_construction: pos_integer() | nil,
  enable_range_opt: boolean() | nil,
  enable_wildcard: boolean() | nil,
  m: pos_integer() | nil,
  metric: :l2 | :ip | :cosine | :mipsl2 | nil,
  n_iters: pos_integer() | nil,
  n_list: pos_integer() | nil,
  quantize: :fp16 | :int8 | :int4 | nil,
  type: :hnsw | :ivf | :flat | :invert,
  use_soar: boolean() | nil
}

Index configuration struct. See module documentation for field details.

Functions

from_opts(opts)

@spec from_opts(keyword()) :: t()

Builds an IndexParams struct from a keyword list.

The :type key is required; all others are optional and default to nil (which lets zvec use its own defaults).