Muninn.Schema.Field (Muninn v0.5.5)

View Source

Represents a field in a Muninn schema.

Summary

Functions

Creates a new field.

Converts a field to a map representation.

Types

field_type()

@type field_type() ::
  :text | :u64 | :i64 | :f64 | :bool | :date | :facet | :bytes | :json

t()

@type t() :: %Muninn.Schema.Field{
  fast: boolean(),
  indexed: boolean(),
  name: String.t(),
  stored: boolean(),
  tokenizer: String.t() | nil,
  type: field_type()
}

Functions

new(type, name, opts \\ [])

@spec new(field_type(), String.t(), keyword()) :: t()

Creates a new field.

Options

  • :stored - Whether to store the field value (default: false)
  • :indexed - Whether to index the field (default: true)
  • :fast - Whether to enable fast field (columnar) storage (default: false). Required for sorting and aggregations on numeric fields.
  • :tokenizer - Tokenizer to use for text fields (default: nil, uses "default"). Built-in options: "default", "raw", "en_stem", "whitespace".

to_map(field)

@spec to_map(t()) :: map()

Converts a field to a map representation.