Ecto-native search for Phoenix apps

Search indexing that feels native to Ecto.

Scrypath, the Ecto-native search indexing library, helps Phoenix and Ecto teams declare searchable schemas, sync records after writes, recover drift when the index falls behind, and keep behavior explicit instead of hiding search behind callbacks.

Install from Hex
{:scrypath, "~> 0.3"}
Supported baseline
Elixir 1.17+, OTP 26-28
Verify locally
mix verify.adopter
How it fits schema -> sync -> search
use Scrypath,
  fields: [:title, :body],
  filterable: [:status],
  sortable: [:inserted_at]

def search_posts(query) do
  Scrypath.search(Post, query,
    backend: Scrypath.Meilisearch,
    repo: Repo
  )
end

{:ok, _sync} =
  Scrypath.sync_record(Post, post,
    backend: Scrypath.Meilisearch,
    sync_mode: :inline
  )

What ships today

One library, four clear jobs.

Start with schema metadata, choose how writes reach Meilisearch, and keep the repair path visible when production data changes faster than the index.

Schema declaration

use Scrypath is metadata-only. Schemas declare searchable fields, faceting, sort fields, and tenant boundaries without becoming a framework facade.

First-hour path

Sync modes

Choose :inline, :manual, or :oban with eyes open. Accepted work is not the same thing as search visibility.

Sync modes

Recovery and drift

Backfill, reindex, failed-work triage, and reconciliation commands are built into the adoption path instead of left as application folklore.

Recovery guide

Tenant-safe access

Shared-index safety has first-class declarations and runtime scopes so tenant guards are harder to forget and harder for user filters to replace.

Multitenancy docs

Who this is for

Three personas, one boundary.

App developer

Get one schema searchable without inventing a subsystem.

Declare metadata, call sync_record/3 after a successful write, and keep search inside the context boundary.

Operator / SRE

See when the index is stale, wedged, or drifting.

Use mix verify.adopter, the example app, and the operator docs to tell the difference between queue lag, search drift, and app-side mistakes.

Evaluator

Decide quickly whether Scrypath is the right search layer.

Check the fit, inspect the supported path, then open the guide that matches the next job you need to do.

Where to go next

Choose the path that matches your question.

Install and verify

Install, then verify locally.

Install the package, wire one schema, and run mix verify.adopter when you want a quick confidence check. Use the Phoenix example when you want to see Meilisearch and Oban involved before adopting the production path.