Scrypath.Meilisearch (scrypath v0.3.0)

Copy Markdown View Source

Meilisearch-specific runtime entrypoints for Scrypath.

Scrypath.* remains the common path for sync and the stable search happy path. This namespace is the explicit escape hatch for Meilisearch-native behavior that should stay visible instead of being tunneled through generic options.

Use Scrypath.search/3 for text plus validated filter:, sort:, page:, and optional explicit hydration through repo:. Use Scrypath.Meilisearch.search/3 when you need native Meilisearch payloads that do not belong on the common path.

Summary

Functions

apply_settings(schema_module, index_name, config \\ [])

@spec apply_settings(module(), String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}

create_index(schema_module, primary_key, config \\ [])

@spec create_index(module(), String.t() | atom() | nil, keyword()) ::
  {:ok, map()} | {:error, term()}

search(schema_module, query, config)

@spec search(module(), Scrypath.Query.t() | map() | String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}

Run a native Meilisearch search request against either the live index or an explicit target/index override.

swap_indexes(schema_module, config \\ [])

@spec swap_indexes(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}