Prompt
Which search stack works well with Postgres and permissions?
Latest observation
Oct 12, 2026
OpenAI APIWeb search: off
If you want a search stack that pairs well with Postgres and supports permissions / ACL-aware search, the best fit is usually:
Best overall: OpenSearch or Elasticsearch + Postgres as source of truth
- Postgres stores your relational data and permission model.
- OpenSearch/Elasticsearch handles full-text search, filtering, ranking, faceting, etc.
- Permissions are typically enforced by:
- indexing ACL fields into the search documents, then filtering queries by user/org/team access
- or checking permissions in Postgres before/after search results are returned
Why this works well
- Excellent full-text search performance
- Supports complex filtering and faceting
- Mature ecosystem
- Works fine as a read-optimized index alongside Postgres
Common pattern
- Write data to Postgres
- Emit change events via:
- application code
- CDC (like Debezium)
- queue/stream
- Sync to OpenSearch/Elasticsearch
- At query time:
- search engine does text search
- permission filters are applied using indexed permission attributes
If you want something simpler and Postgres-native
Postgres full-text search + pg_trgm
Good when:
- your search needs are moderate
- you want fewer moving parts
- permissions are already modeled in Postgres
Pros:
- no extra search cluster
- easy transactional consistency with permissions
- simplest operationally
Cons:
- weaker relevance tuning than dedicated search engines
- less powerful faceting/autocomplete at scale
A very common approach is:
- use Postgres FTS for basic search
- use row-level security (RLS) for permissions
This is often the cleanest if your app is mostly relational and search isn’t super advanced.
If permissions are first-class and you want secure search
OpenSearch/Elasticsearch + app-side permission filtering
This is usually better than relying on the search engine alone for authorization.
Recommended if:
- permissions are per-user / per-group / per-tenant
- you need tenant isolation
- search results must not leak inaccessible documents
Avoid designs where search alone decides visibility unless you’ve very carefully modeled ACL filters.
Other options
Meilisearch / Typesense
Good developer experience, easy to operate, fast for simple search.
But:
- permissions/ACL support is usually more limited
- you often need to implement access filtering yourself
These are nice for small-to-medium apps, but less ideal for complex permission models.
Practical recommendation
- Simple app, strong Postgres coupling, basic search:
Postgres FTS + RLS - Serious search needs + permissions:
Postgres + OpenSearch/Elasticsearch - Very lightweight search, fewer features:
Typesense/Meilisearch + app-side filters
If you tell me:
- your data size,
- whether permissions are per-user, per-group, or per-tenant,
- and whether you need autocomplete/facets/ranking,
I can recommend a specific stack and schema pattern.