Schema declaration
use Scrypath is metadata-only. Schemas declare searchable fields, faceting, sort
fields, and tenant boundaries without becoming a framework facade.
Ecto-native search for Phoenix apps
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.
{:scrypath, "~> 0.3"}Elixir 1.17+, OTP 26-28mix scrypath.status MyApp.Postuse 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
Start with schema metadata, choose how writes reach Meilisearch, and keep the repair path visible when production data changes faster than the index.
use Scrypath is metadata-only. Schemas declare searchable fields, faceting, sort
fields, and tenant boundaries without becoming a framework facade.
Choose :inline, :manual, or :oban with eyes open. Accepted work is not the same
thing as search visibility.
Backfill, reindex, failed-work triage, and reconciliation commands are built into the adoption path instead of left as application folklore.
Recovery guideShared-index safety has first-class declarations and runtime scopes so tenant guards are harder to forget and harder for user filters to replace.
Multitenancy docsWho this is for
App developer
Declare metadata, call sync_record/3 after a successful write, and keep search inside
the context boundary.
Operator / SRE
Use mix scrypath.status, mix scrypath.reconcile, the example app, and the
operator docs to tell the difference between queue lag, search drift, and app-side mistakes.
Evaluator
Check the fit, inspect the supported path, then open the guide that matches the next job you need to do.
Where to go next
Install and verify
Install the package, wire one schema, and run mix scrypath.status against it when you
want a quick look at sync visibility. Use the Phoenix example when you want to see Meilisearch
and Oban involved before adopting the production path.