# `Scrypath`
[🔗](https://github.com/szTheory/scrypath/blob/v0.3.0/lib/scrypath.ex#L1)

Runtime reflection helpers for searchable schemas declared with `use Scrypath`.

Phase 1 keeps the public runtime surface small:

- `schema_config/1`
- `schema_fields/1`
- `schema_settings/1`
- `document_source/1`
- `document_id_field/1`

These functions keep reflection under `Scrypath.*` modules instead of generating
schema-specific runtime verbs.

## Examples

    iex> config = Scrypath.schema_config(SearchablePost)
    iex> config.fields
    [:title, :body]

# `backfill`

```elixir
@spec backfill(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

# `delete_document`

```elixir
@spec delete_document(module(), term(), keyword()) :: {:ok, term()} | {:error, term()}
```

# `delete_documents`

```elixir
@spec delete_documents(module(), [term()], keyword()) ::
  {:ok, term()} | {:error, term()}
```

# `delete_record`

```elixir
@spec delete_record(module(), struct() | map(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

# `document_id_field`

```elixir
@spec document_id_field(module()) :: atom()
```

# `document_source`

```elixir
@spec document_source(module()) :: atom()
```

# `reindex`

```elixir
@spec reindex(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

# `schema_config`

```elixir
@spec schema_config(module()) :: map()
```

# `schema_fields`

```elixir
@spec schema_fields(module()) :: [atom()]
```

# `schema_settings`

```elixir
@spec schema_settings(module()) :: map()
```

# `search`

```elixir
@spec search(module(), String.t(), keyword()) :: {:ok, term()} | {:error, term()}
```

# `search!`

```elixir
@spec search!(module(), String.t(), keyword()) :: term()
```

# `sync_record`

```elixir
@spec sync_record(module(), struct() | map(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

# `sync_records`

```elixir
@spec sync_records(module(), [struct() | map()], keyword()) ::
  {:ok, term()} | {:error, term()}
```

# `sync_status`

```elixir
@spec sync_status(
  module(),
  keyword()
) :: {:ok, Scrypath.Operator.Status.t()} | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
