pg_search
Ruby gem that adds PostgreSQL full-text search scopes to Active Record models.
pg_search is a Ruby gem that builds named scopes for Active Record models, taking advantage of PostgreSQL’s full-text search. The README is the reference for its setup and search options.
Rails projects get the gem’s rake tasks through a Railtie, which the README contrasts with non-Rails projects. The gem is installed with gem install or a Gemfile line, and it needs a PostgreSQL server. Some of its features need PostgreSQL extensions.
Casebook, PBC maintains the gem.
Worth knowing
The name is shared with ParadeDB’s pg_search, a PostgreSQL extension and a separate project with its own record. The gem has no project site of its own, so the repository is the reference.
Sources
- 2026-10-28: links, Written in, GitHub stars
github.com/Casecommons/pg_search - 2026-10-28: links, License, Categories, Built on, Databases, Install with
github.com/Casecommons/pg_search/blob/master/README.md - 2026-10-28: First release
rubygems.org/api/v1/versions/pg_search.json - 2026-10-28: Maintainer
github.com/Casecommons/pg_search/blob/master/LICENSE - 2026-10-28: Runtime, Minimum runtime
github.com/Casecommons/pg_search/blob/v2.4.0/pg_search.gemspec - 2026-10-28: Current major version, Last release
rubygems.org/api/v1/gems/pg_search.json - 2026-10-28: Contributors
api.github.com/repos/Casecommons/pg_search/contributors?per_page=1 - 2026-10-28: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/rubygems.org/packages/pg_search