gkovrey/postgres-search-bundle
gkovrey/postgres-search-bundle integrates PostgreSQL full-text search into Symfony/PHP applications, offering database-native indexing and query support for fast, relevant search results without an external search engine. Configurable, lightweight, and easy to wire into existing projects.
tsvector/tsquery, GIN indexes, ts_rank) wired into Doctrine, or to add a dedicated engine (Elasticsearch/OpenSearch, Meilisearch, Typesense, Algolia). This bundle is the archetype of the first path: it moves the decision from "do we stand up a search cluster?" to "do we add ~a few hundred lines of Doctrine plumbing?"tsvector columns, GIN indexes, custom DQL functions, and tsquery construction, then reimplement the useful 10% internally. This is a fork-the-ideas, not fork-the-repo, decision.Consider the approach (not necessarily the package) when:
Look elsewhere when:
tsquery is where the "cheap" option stops being cheap.NativeQuery/ResultSetMapping (the pragmatic default), a maintained Postgres-FTS Doctrine extension, or a managed engine (Meilisearch/Typesense for low-ops simplicity, OpenSearch/Elasticsearch for scale and relevance control).To executives: We evaluated a package for adding search to the product and are recommending against adopting it as a dependency — it targets Symfony 2, has had no release since 2016, and has no downstream users, so any defect or security issue becomes ours to fix. The underlying idea is still the right call for now: PostgreSQL, which we already run, can deliver keyword search with relevance ranking, so we can launch search without a new infrastructure line item, a new vendor contract, or a data-sync pipeline — an estimated 1–2 sprint effort for a small internal implementation based on this package's design. I'm also proposing we decide up front what would make us graduate to a dedicated search engine (multilingual relevance, typo tolerance, faceting, or search load affecting checkout-path latency), so this stays a deliberate stopgap rather than an accidental permanent commitment. Risk is bounded and reversible: the data stays in Postgres, and a future migration to a dedicated engine is additive.
To engineering: Treat this repo as a design document, not a dependency. Read it for the tsvector column and GIN index modeling, the custom DQL function wiring for to_tsquery/ts_rank, and how it handles result highlighting. Then build a thin internal adapter with explicit ownership: parameterized tsquery construction (no string concatenation — injection surface), index-maintenance strategy on write, and tests that assert ranking stability rather than exact scores. Budget 1–2 days of spike plus the sprint to productionize, and capture it as internal code we control.
How can I help you explore Laravel packages today?