Configuration builder for zvec initialization.
All fields are optional. nil values use zvec defaults.
Example
Zvex.Config.new()
|> Zvex.Config.memory_limit(1_073_741_824)
|> Zvex.Config.query_threads(4)
|> Zvex.Config.log(:console, level: :warn)
Summary
Functions
Sets the key-count ratio threshold for falling back to brute-force search.
Sets the ratio threshold for switching from inverted index scan to forward scan.
Configures console logging for the zvec engine.
Sets the maximum memory usage in bytes for the zvec engine.
Creates a new configuration with all fields set to nil (zvec defaults).
Sets the number of threads used for index optimization.
Sets the number of threads used for query execution.
Converts the configuration to the flat map format expected by the NIF layer.
Validates the configuration using the Zoi schema. Returns {:ok, config} or an error.
Types
@type t() :: %Zvex.Config{ brute_force_by_keys_ratio: nil | nil | float(), invert_to_forward_scan_ratio: nil | nil | float(), log: nil | nil | {:console, %{optional(:level) => :debug | :info | :warn | :error | :fatal}}, memory_limit: nil | nil | integer(), optimize_threads: nil | nil | integer(), query_threads: nil | nil | integer() }
Functions
Sets the key-count ratio threshold for falling back to brute-force search.
Sets the ratio threshold for switching from inverted index scan to forward scan.
Configures console logging for the zvec engine.
Options
:level— minimum log level::debug,:info,:warn,:error, or:fatal.
@spec memory_limit(t(), pos_integer()) :: t()
Sets the maximum memory usage in bytes for the zvec engine.
@spec new() :: t()
Creates a new configuration with all fields set to nil (zvec defaults).
@spec optimize_threads(t(), pos_integer()) :: t()
Sets the number of threads used for index optimization.
@spec query_threads(t(), pos_integer()) :: t()
Sets the number of threads used for query execution.
Converts the configuration to the flat map format expected by the NIF layer.
@spec validate(t()) :: {:ok, t()} | {:error, Zvex.Error.t()}
Validates the configuration using the Zoi schema. Returns {:ok, config} or an error.